// The "User-agent: BadCrawler" means this section applies to BadCrawler.
// The "User-agent: *" means this section applies to all robots.
// The "Disallow: /" tells the robot that it should not visit any pages on the site.
// section 1,禁止 User-agent 中的用户代理爬取该网站
# section 1
User-agent: BadCrawler
Disallow: /
// section 2,无论何种代理,在两次下载请求之间给出 5 秒的延迟,否则会封禁你的 IP 一段时间或者永远封禁
# section 2
User-agent: *
Crawl-delay: 5
Disallow: /trap
// section 3,网站提供的 Sitemap 文件(网站地图)可以帮助爬虫定位最新的内容,而无需爬取每一个网页
# section 3
Sitemap: http://example.webscraping.com/sitemap.xml
robots.txt 浅析
最新推荐文章于 2024-08-14 16:31:41 发布