title: python - requests timeout for the whole request?
body: <p>I am crawling many sites for data, but some links are freezing my script permanently. This shouldn't happen, since I used a timeout like this :</p>
  
  <pre><code>page = requests.get(url,timeout=4)
  </code></pre>
  
  <p>I want a timeout for the whole request. So when the request take 4 seconds it will stop trying.
  I searched <code>requests</code> documentation, and I found this code for read and connect timeout:</p>
  
  <pre><code>r = requests.get(url, timeout=(3.05, 27))
  </code></pre>
  
  <p>However, I get a type error when I try and use it:</p>
  
  <pre><code>Timeout value connect was (3.05, 27), but it must be an int or float.
  </code></pre>
  
  <p>How can I get the timeout I want?</p>