Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用python处理自定义404页面 [50]中的requests.get(“http://outage-outsourcing.oracle.com/") 出[50]:_Python_Url_Request_Http Status Code 404 - Fatal编程技术网

如何使用python处理自定义404页面 [50]中的requests.get(“http://outage-outsourcing.oracle.com/") 出[50]:

如何使用python处理自定义404页面 [50]中的requests.get(“http://outage-outsourcing.oracle.com/") 出[50]:,python,url,request,http-status-code-404,Python,Url,Request,Http Status Code 404,上面的url给出的消息是“此应用程序当前不可用。我们为给您带来的不便深表歉意。”。它应该返回状态代码404,因为页面不工作,我如何处理定义了自定义错误页面的情况。由他们发送什么http状态代码决定。对此,您无能为力。 您可以定义自己的标准来识别它们。 例如,您可以在响应中搜索错误消息以识别它们。那么基本上,对于每个自定义页面,我们都需要定义标准吗?或者这些URL中有没有什么东西比其他URL不包含某些标题? In[50]: requests.get("http://outage-outsourci

上面的url给出的消息是“此应用程序当前不可用。我们为给您带来的不便深表歉意。”。它应该返回状态代码404,因为页面不工作,我如何处理定义了自定义错误页面的情况。

由他们发送什么http状态代码决定。对此,您无能为力。 您可以定义自己的标准来识别它们。
例如,您可以在响应中搜索错误消息以识别它们。

那么基本上,对于每个自定义页面,我们都需要定义标准吗?或者这些URL中有没有什么东西比其他URL不包含某些标题?
In[50]: requests.get("http://outage-outsourcing.oracle.com/")
Out[50]: <Response [200]>