【发布时间】:2019-01-16 02:33:54
【问题描述】:
Broswer shows page not found but request module gives 200 as status code
In[23]: requests.get("http://abc.us.gib.com/tool/cluster.jsp")
Out[23]: <Response [200]>
In[24]: requests.get("http://abc.us.gib.com/tool/cluster.jsphttp://abc.us.gib.com/tool/cluster.jsp")
Out[24]: <Response [200]>
给定两个 URL,浏览器对第一个 URL 工作正常,但对第二个 URL 给出错误,但在使用 python 请求模块检查相同时,它给出 200 作为两者的状态码。 附上图片供参考。
您将无法打开该 URL,因为外部无法访问。
【问题讨论】:
-
abc.us.gib.com/tool/cluster.jsphttp://abc.us.gib.com/tool/… 不是有效的 URL,请求为我引发异常
-
是的..您将无法访问该 URL,因为它需要 VPN 连接到特定服务器。
-
获取函数需要一个有效的 url kite.com/python/docs/requests.get
-
网址有效,只是在我的网络之外无法访问
标签: python python-requests http-status-code-404