Heim  >  Fragen und Antworten  >  Hauptteil

python - HTTP Error 599

问题描述

爬取小米应用商店的某款应用时,出现 599 报错:

[E 160905 17:22:05 base_handler:195] HTTP 599: Resolving timed out after 20001 milliseconds
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/pyspider/libs/base_handler.py", line 188, in run_task
        result = self._run_task(task, response)
      File "/usr/local/lib/python2.7/site-packages/pyspider/libs/base_handler.py", line 167, in _run_task
        response.raise_for_status()
      File "/usr/local/lib/python2.7/site-packages/pyspider/libs/response.py", line 190, in raise_for_status
        raise http_error
    HTTPError: HTTP 599: Resolving timed out after 20001 milliseconds

待爬取的链接为:
http://app.mi.com/search?keywords=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C

直接粘贴该连接到浏览器中,可以显示出页面 ———— 但是页面中的图片不能显示出来。

求解

1、为什么会出现 599 错误?怎么解决?
2、直接粘贴该链接,为什么不能显示出图片?(通过小米的首页上搜索,可以显示出图片)

谢谢!

黄舟黄舟2742 Tage vor957

Antworte allen(5)Ich werde antworten

  • 巴扎黑

    巴扎黑2017-04-18 09:54:37

    贴代码上来,一般599不是远程服务器的问题而是本机的问题,看报错应该是电脑dns有问题,重新设置一下

    Antwort
    0
  • PHPz

    PHPz2017-04-18 09:54:37

    代码有些少……而且完全没有出现题主说的问题

    Antwort
    0
  • 天蓬老师

    天蓬老师2017-04-18 09:54:37

    「直接粘贴该连接到浏览器」你这里的浏览器和运行脚本的电脑是同一台吗?

    curl -v http://app.mi.com/search?keywords=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C 的结果

    Antwort
    0
  • PHP中文网

    PHP中文网2017-04-18 09:54:37

    599是网络超时,可能是因为服务器代理引起的。

    599 NETWORK CONNECT TIMEOUT ERROR
    This status code is not specified in any RFCs, but is used by some HTTP proxies to signal a network connect timeout behind the proxy to a client in front of the proxy.

    链接

    Antwort
    0
  • PHP中文网

    PHP中文网2017-04-18 09:54:37

    你好,这个问题解决了吗?现在遇到了同样的问题,能否说一下你的解决方案,蟹蟹!

    Antwort
    0
  • StornierenAntwort