YandexBot 的 User Agent

Yandex 的主索引爬虫。渲染页面时,UA 里爬虫标识后面可能带上 Chrome 版本号,所以 Yandex 建议在日志里检索时不要限定这个版本。下面是它发送的原文、每一段的含义,以及如何放行或屏蔽它。

Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)

一览

类型搜索引擎爬虫
运营方Yandex
用途Yandex 搜索的主索引爬虫
版本3.0
robots.txt 标识YandexBot
如何核验反向 DNS 主机名以 yandex.ru、yandex.net 或 yandex.com 结尾,并能正向解析回同一 IP。

在 robots.txt 里放行或屏蔽

禁止 YandexBot 抓取全站

User-agent: YandexBot
Disallow: /

重新放行

User-agent: YandexBot
Allow: /

逐段拆解

片段含义
Mozilla/5.0历史兼容标记。几乎所有浏览器都自称 "Mozilla/5.0",以免老旧服务器返回残缺页面。
compatible兼容性标记——早年由 IE 发送,如今多见于爬虫。
YandexBot/3.0YandexBot 3.0 —— 自动化爬虫/机器人,不是真实浏览器。
+http://yandex.com/bots爬虫运营方提供给站长的说明页地址。

在代码里使用

curl

curl -A "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" https://example.com

Python (requests)

import requests
requests.get("https://example.com", headers={"User-Agent": "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"})

Playwright (Node.js)

const context = await browser.newContext({ userAgent: "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" });

来源:How to check that a robot belongs to Yandex · 核对于 2026年9月

相关 User Agent

全部 User Agent →

你的浏览器发的是什么?查看我的 User Agent →