我不明白如何使用robotparser模塊中的解析函數。這是我試過的:使用python robotparser
In [28]: rp.set_url("http://anilattech.wordpress.com/robots.txt")
In [29]: rp.parse("""# If you are regularly crawling WordPress.com sites please use our firehose to receive real-time push updates instead.
# Please see http://en.wordpress.com/firehose/ for more details.
Sitemap: http://anilattech.wordpress.com/sitemap.xml
User-agent: IRLbot
Crawl-delay: 3600
User-agent: *
Disallow: /next/
# har har
User-agent: *
Disallow: /activate/
User-agent: *
Disallow: /signup/
User-agent: *
Disallow: /related-tags.php
# MT refugees
User-agent: *
Disallow: /cgi-bin/
User-agent: *
Disallow:""")
In [48]: rp.can_fetch("*","http://anilattech.wordpress.com/signup/")
Out[48]: True
看起來rp.entries是[]。我不明白什麼是錯的。我嘗試過更簡單的例子,但同樣的問題。