title: Only download a part of the document using python requests
body: <p>I'm writing a web scraper using python-requests.</p>
  
  <p>Each page is over 1MB, but the actual data I need to extract is very early on in the document's flow, so I'm wasting time downloading a lot of unnecessary data.</p>
  
  <p>If possible I would like to stop the download as soon as the required data appears in the document's source code, in order to save time.</p>
  
  <p>For example, I only want to extract the text in the "abc" Div, the rest of the document is useless:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;My site&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="abc"&gt;blah blah...&lt;/div&gt;
  
  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris fermentum molestie ligula, a pharetra eros mollis ut.&lt;/p&gt;
  &lt;p&gt;Quisque auctor volutpat lobortis. Vestibulum pellentesque lacus sapien, quis vulputate enim mollis a. Vestibulum ultrices fermentum urna ac sodales.&lt;/p&gt;
  &lt;p&gt;Nunc sit amet augue at dolor fermentum ultrices. Curabitur faucibus porttitor vehicula. Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;/p&gt;
  &lt;p&gt;Etiam sed leo at ipsum blandit dignissim ut a est.&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Currently I'm simply doing:</p>
  
  <pre><code>r = requests.get(URL)
  </code></pre>