V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
codeframe
V2EX  ›  V2EX

V2EX站点的robots.txt

  •  
  •   codeframe · 2013-01-29 10:35:44 +08:00 · 2990 次点击
    这是一个创建于 4103 天前的主题,其中的信息可能已经有所发展或是发生改变。
    昨天看python2.7标准库的robotparser,随手就拿V2EX的robots.txt试了一下,结果发现与预期的结果不一致。代码如下:

    import robotparser

    rp = robotparser.RobotFileParser()
    rp.read()
    rp.can_fetch('*', '/signin')
    rp.can_fetch('*', 'http://v2ex.com/signin')

    两个can_fetch都是返回True。

    我看了一下robots.txt,在 User-agent: * 和 Disallow: /backstage/ 之间有空行。应该是这个空行引起的。想知道这一空行在语法上是不是允许的?
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3368 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 11:32 · PVG 19:32 · LAX 04:32 · JFK 07:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.