title: Python URL Gets Method returns status 200, even though it is 404
body: <p>I am using the following code to return the status of an URL</p>
  
  <pre><code>import requests
  answer = requests.get('http://www.website.com')
  answer.status_code
  &gt;&gt;&gt;200
  </code></pre>
  
  <p>Which gives me back 200.</p>
  
  <p>However, the website should return 404.</p>
  
  <pre><code>answer.content
  &gt;&gt;&gt;b'&lt;html&gt;&lt;head&gt;\r\n&lt;title&gt;404 Not Found&lt;/title&gt;\r\n&lt;/head&gt;&lt;body&gt;\r\n&lt;h1&gt;Not   Found&lt;/h1&gt;\r\n&lt;p&gt;The requested URL index.php was not found on this server.&lt;/p&gt;\r\n&lt;hr&gt;\r\n&lt;address&gt;Apache/2.2.22 (Linux) Server at Port &lt;small onclick="document.getElementById(\'login\').style.display = \'block\';"&gt;80&lt;/small&gt;&lt;/address&gt;\r\n&lt;/body&gt;&lt;/html&gt;&lt;div id="login" style="display:none;"&gt;&lt;pre align=center&gt;&lt;form method=post&gt;Password: &lt;input type=password name=pass&gt;&lt;input type=submit value=\'&gt;&gt;\'&gt;&lt;/form&gt;&lt;/pre&gt;&lt;/div&gt;'
  </code></pre>
  
  <p>Can someone tell me where the discrepancy stems from and how I can fix this to get answer.status_code = 404 as result instead of 200? I have no direct access to the server, but I can ask the administrator.</p>
  
  <p>Thank you! </p>