0
我測試Reppy與google.com.robots.txt,但與某些條目它有點任性。Reppy的行爲與某些條目奇怪
下面是那些:
Disallow: /alerts/
,這裏必須得到一個假。
Allow: /alerts/$
,這裏必須得到一個True。
我得到True
的第一個和False
第二項。 雖然我在其他條目中得到了正確的結果。
>>> import reppy
>>> from reppy.cache import RobotsCache
>>> robots = RobotsCache()
>>> rules = robots.fetch("http://google.com")
>>> rules.allowed('/search', 't')
False
>>> rules.allowed('/search/about', 't')
True
#While things are right above, they are unexpected below
>>> rules.allowed('/alerts/', 't')
True # FALSE is expected here
>>> rules.allowed('/alerts/$', 't')
False # TRUE is expected here
>>>
我會很感激,如果有人給我一個提示,看看糾正這一點。
謝謝!完全明白這一點。 – abT