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.0 | YandexBot 3.0 —— 自动化爬虫/机器人,不是真实浏览器。 |
+http://yandex.com/bots | 爬虫运营方提供给站长的说明页地址。 |
在代码里使用
curl
curl -A "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" https://example.comPython (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月