title: Python: Save page's dynamic image
body: <p>I need to programmatically load contents of a HTML page which has a dynamic image in its body.  Then I want to download and save this image as it shows THAT time in THAT page load.</p>
  
  <p>Example of the image in HTML:</p>
  
  <pre><code>&lt;img src="image.php"&gt;
  </code></pre>
  
  <p>The thing is I cant just fetch contents of the PHP script at <code>http://example.com/image.php</code> because it will just generate and return me another image, not the same image generated in the original page.</p>
  
  <p>So, how to save image generated in that page? I know i can't use <a href="https://docs.python.org/2/library/webbrowser.html" rel="nofollow">webbrowser</a> because it opens an actual browser window. I'm considering to use <a href="https://pypi.python.org/pypi/zope.testbrowser" rel="nofollow">zope.testbrowser</a> or maybe <a href="http://wwwsearch.sourceforge.net/mechanize/" rel="nofollow">mechanize</a>, but cound't find any info on how to do it.</p>
  
  <p>Could you guys help me?</p>