【问题标题】:Why does Chrome request a robots.txt?为什么 Chrome 会请求 robots.txt?
【发布时间】:2017-09-17 13:48:57
【问题描述】:

我在日志中注意到 Chrome 请求了 robots.txt 以及我期望的所有内容。

[...]
2017-09-17 15:22:35 - (sanic)[INFO]: Goin' Fast @ http://0.0.0.0:8080
2017-09-17 15:22:35 - (sanic)[INFO]: Starting worker [26704]
2017-09-17 15:22:39 - (network)[INFO][127.0.0.1:36312]: GET http://localhost:8080/  200 148
2017-09-17 15:22:39 - (sanic)[ERROR]: Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/sanic/app.py", line 493, in handle_request
    handler, args, kwargs, uri = self.router.get(request)
  File "/usr/local/lib/python3.5/dist-packages/sanic/router.py", line 307, in get
    return self._get(request.path, request.method, '')
  File "/usr/local/lib/python3.5/dist-packages/sanic/router.py", line 356, in _get
    raise NotFound('Requested URL {} not found'.format(url))
sanic.exceptions.NotFound: Requested URL /robots.txt not found

2017-09-17 15:22:39 - (network)[INFO][127.0.0.1:36316]: GET http://localhost:8080/robots.txt  404 42
[...]

我正在运行 Chromium:

60.0.3112.113 (Developer Build) Built on Ubuntu, running on Ubuntu 16.04 (64-bit)

为什么会这样? 有人可以详细说明吗?

【问题讨论】:

  • 注意是robots.txt,而不是robot.txt
  • 你能重现这个还是这只是你在日志中看到的?
  • 我已经切换了浏览器,但我可以通过在本地计算机上重新启动服务器并发送请求来重现它。
  • 你有类似的元标记:<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
  • @MondKin 有一段时间了,我以前没有考虑过这个(我很傻)。果然我今天检查了我可以使用哪些扩展,并将 wappalyzer 确定为罪魁祸首github.com/AliasIO/Wappalyzer/blob/… 如果你把它放在答案中,我会奖励你赏金

标签: google-chrome chromium robots.txt


【解决方案1】:

请求robots.txt 文件的可能不是您的网站,而是Chrome 扩展程序之一(如您提到的Wappalizer)。这可以解释为什么它只发生在 Chrome 中。

要确定您可以检查 Chrome 的 DevTools 的网络选项卡,以查看请求是在什么时候发出的,以及它是否来自您的脚本之一。

【讨论】:

    【解决方案2】:

    对于 chrome,有一个插件 (SeeRobots) 可以检查 robots.txt 是否为搜索引擎等定义了规则 - 可能你已经安装了这个插件?

    https://chrome.google.com/webstore/detail/seerobots/hnljoiodjfgpnddiekagpbblnjedcnfp?hl=de

    【讨论】:

      猜你喜欢
      • 2013-02-13
      • 1970-01-01
      • 2021-01-18
      • 2020-03-20
      • 1970-01-01
      • 2020-12-31
      • 1970-01-01
      • 2013-11-22
      • 1970-01-01
      相关资源
      最近更新 更多