我有以下robots.txtPython的robotparser忽视的Sitemaps
User-agent: *
Disallow: /images/
Sitemap: http://www.example.com/sitemap.xml
及以下robotparser
def init_robot_parser(URL):
robot_parser = robotparser.RobotFileParser()
robot_parser.set_url(urlparse.urljoin(URL, "robots.txt"))
robot_parser.read()
return robot_parser
但是当我做了print robot_parser
以上return robot_parser
我得到的是
User-agent: *
Disallow: /images/
为什么它忽略了Sitemap线,我错过了什么?
是的,但我需要看看是否有指定的站点地图来解析它们。我想我只需要通过urlopen打开机器人。谢谢。 – Ben 2010-06-04 22:29:04