Why doesn't Python's "robotparser" like Wikipedia's "robots.txt" file?

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Tue Oct 2 00:24:16 EDT 2007


In message <HYiMi.9932$JD.6615 at newssvr21.news.prodigy.net>, John Nagle
wrote:

>     For some reason, Python's parser for "robots.txt" files
> doesn't like Wikipedia's "robots.txt" file:
> 
>  >>> import robotparser
>  >>> url = 'http://wikipedia.org/robots.txt'
>  >>> chk = robotparser.RobotFileParser()
>  >>> chk.set_url(url)
>  >>> chk.read()
>  >>> testurl = 'http://wikipedia.org'
>  >>> chk.can_fetch('Mozilla', testurl)
> False
>  >>>

    >>> chk.errcode
    403

Significant?




More information about the Python-list mailing list