一些服务器具有robots.txt文件,以阻止web爬虫在其网站中爬行。有没有办法让网络爬虫忽略robots.txt文件?我正在为python使用Mechanize。
发布于 2011-12-05 22:10:33
mechanize的documentation具有以下示例代码:
br = mechanize.Browser()
....
# Ignore robots.txt. Do not do this without thought and consideration.
br.set_handle_robots(False)这就是你想要的。
发布于 2011-12-05 22:09:31
看起来像您所需要的:
from mechanize import Browser
br = Browser()
# Ignore robots.txt
br.set_handle_robots( False )但是你知道你在做什么…
https://stackoverflow.com/questions/8386481
复制相似问题