V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
codeframe
V2EX  ›  V2EX

V2EX站点的robots.txt

  •  
  •   codeframe · Jan 29, 2013 · 3801 views
    This topic created in 4836 days ago, the information mentioned may be changed or developed.
    昨天看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/ 之间有空行。应该是这个空行引起的。想知道这一空行在语法上是不是允许的?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3200 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:39 · PVG 21:39 · LAX 06:39 · JFK 09:39
    ♥ Do have faith in what you're doing.