【问题标题】:How to read webpages sending fake 404 header如何阅读发送虚假 404 标头的网页
【发布时间】:2013-02-13 15:12:17
【问题描述】:

爬虫有什么方法可以从发送虚假 404 标头的页面中读取 html。我尝试使用implodecurlfile_get_contents 获取页面仍然出现标题404 错误。similar SO reference link

【问题讨论】:

  • 你是怎么推断出它是假标题的?
  • @DoSparKot 因为显示了网页页面

标签: php header http-status-code-404 web-crawler


【解决方案1】:

您可能想要使用 curl(或 Guzzle)并实际添加用户代理以及请求。如果没有提供(或阻止)用户代理,某些网站会返回 404(或其他错误)

【讨论】:

    猜你喜欢
    • 2012-03-06
    • 1970-01-01
    • 2016-09-03
    • 2018-04-29
    • 2011-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-10
    相关资源
    最近更新 更多