[英]request module in python library gives status code as 200 when the browser gives 404
Broswer shows page not found but request module gives 200 as status code Broswer显示页面未找到,但请求模块给出200作为状态码
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]>
Given Two URL, the browser works fine for the first URL but gives error for the second one which it should but while checking the same with the python request module it gives 200 as status code for the both. 给定两个URL,浏览器对于第一个URL可以正常工作,但对于第二个URL却应该提供错误,但是在与python request模块检查相同的同时,它给出了两个的状态码。 Attached image for reference. 所附图片供参考。
YOU won't be able to open the URL as it is not accessible outside. 您将无法打开该URL,因为无法从外部访问该URL。
The site " http://abc.us.gib.com/tool/cluster.jsphttp://abc.us.gib.com/tool/cluster.jsp " returns wrong status code. 网站“ http://abc.us.gib.com/tool/cluster.jsphttp://abc.us.gib.com/tool/cluster.jsp ”返回错误的状态代码。 Requests module works fine. 请求模块工作正常。 You can check in a browser what status code above site returns. 您可以在浏览器中检查网站上方返回的状态代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.