爬取小米应用商店的某款应用时,出现 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、直接粘贴该链接,为什么不能显示出图片?(通过小米的首页上搜索,可以显示出图片)
谢谢!
天蓬老师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
的结果
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.
链接