原文:
抓取工具”是一個通用名稱,泛指通過跟蹤從一個網頁指向另一個網頁的鏈接,從而自動發現並掃描網站的程序(如漫遊器或“蜘蛛”程序)。Google 的主要抓取工具稱爲 Googlebot。此表格列出了在引用頁日誌中常能見到的 Google 抓取工具的相關信息,以及在 robots.txt、漫遊器元標記和 X-Robots-Tag HTTP 指令中指定這些抓取工具應採用的方法。
抓取工具 | 用戶代理 | HTTP(S) 請求用戶代理 |
---|---|---|
Googlebot(Google 網頁搜索) |
Googlebot |
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html ) 或 (較少使用): Googlebot/2.1 (+http://www.google.com/bot.html ) |
Googlebot 新聞 |
Googlebot-News ( Googlebot ) |
Googlebot-News |
Googlebot 圖片 |
Googlebot-Image ( Googlebot ) |
Googlebot-Image/1.0 |
Googlebot 視頻 |
Googlebot-Video ( Googlebot ) |
Googlebot-Video/1.0 |
Google 移動 |
Googlebot-Mobile |
[各種移動設備類型]( compatible; Googlebot-Mobile/2.1 ; +http://www.google.com/bot.html ) |
Google Mobile AdSense |
Mediapartners-Google 或 ( Googlebot ) |
[各種移動設備類型]( compatible; Mediapartners-Google/2.1 ; +http://www.google.com/bot.html ) |
Google AdSense |
Mediapartners-Google Mediapartners ( Googlebot ) |
Mediapartners-Google |
Google AdsBot 目標網頁質量檢查 |
AdsBot-Google |
AdsBot-Google ( +http://www.google.com/adsbot.html ) |
robots.txt
如果 Google 在 robots.txt 文件中識別出多個用戶代理,則它會跟蹤最具體的用戶代理。如果您希望 Google 的所有抓取工具都能夠抓取您的網頁,則根本不需要 robots.txt 文件。如果您希望禁止或允許 Google 的所有抓取工具訪問您的某些內容,則只需將 Googlebot 指定爲用戶代理即可。例如,如果您希望自己所有的網頁都顯示在 Google 搜索中,並希望在自己的網頁上顯示 AdSense 廣告,則不需要 robots.txt 文件。同樣,如果您不希望 Google 的所有抓取工具訪問您的某些網頁,則可禁止用戶代理 Googlebot(系統會同時禁止 Google 的其他所有用戶代理)。
但是,如果您希望進行更精確的控制,則可以設置地更加具體。例如,您可能希望自己所有的網頁都顯示在 Google 搜索的結果中,但又不希望 Google 抓取您個人目錄中的圖片。在這種情況下,您可以使用 robots.txt 禁止用戶代理 Googlebot-image 抓取您 /personal 目錄中的文件(同時允許 Googlebot 抓取所有文件),具體如下:
User-agent: Googlebot
Disallow:
User-agent: Googlebot-Image
Disallow: /personal
再舉個例子,假設您希望自己的所有網頁上都顯示廣告,但不希望這些網頁出現在 Google 搜索的結果中。這時,您可以禁止 Googlebot,同時允許 Mediapartners-Google,具體如下:
User-agent: Googlebot Disallow: / User-agent: Mediapartners-Google Disallow:
漫遊器元標記
某些網頁會使用多個漫遊器 meta
標記針對不同的抓取工具指定不同的指令,例如:
<meta name="robots" content="nofollow"><meta name="googlebot" content="noindex">
在此示例中,Google 會綜合使用所有的否定指令,因而 Googlebot 會同時遵循 noindex
和 nofollow
指令。
原文轉載自:Google站長工具幫助文檔
原文鏈接: https://support.google.com/webmasters/answer/1061943?hl=zh-Hans