title: Capture embedded google map image with Python without using a browser
body: <p>I have noticed that, from Google Maps page, you can get an "embed" link to put inside an iframe and load the map in a browser. (no news here)</p>
  
  <p>The image size can be adjusted to be very large, so I am interested in getting som big images as single .PNGs.</p>
  
  <p>More specifically, I would like to define a rectangular area from a bounding box (upper-right and lower-left coordinates), and get the corresponding image, with an appropriate zoom factor.</p>
  
  <p>But my question is: How can I use Python to get the "pixel content" of this map as an image object?</p>
  
  <p>(My rationale is: if the browser can get and render such image content, then Python should be capable of doing it, too).</p>
  
  <p>EDIT: this is the content of the HTML file that shows my sample map:</p>
  
  <pre><code>&lt;iframe 
      width="2000"
      height="1500"
      frameborder="0"
      scrolling="yes"
      marginheight="0"
      marginwidth="0"
      src="http://maps.google.com.br/maps?hl=pt-BR&amp;amp;ll=-30.027489,-51.229248&amp;amp;spn=1.783415,2.745209&amp;amp;z=10&amp;amp;output=embed"/&gt;
  </code></pre>
  
  <p>EDIT: I did as suggested by Ned Batchelder, and read the content of an <code>urllib.urlopen()</code> call using the <code>src</code> address taken from the iframe above. The result was a lot of javascript code, which I think has to do with the Google Maps JavaScript API. So, the question lingers: how could I do some useful stuff from all this stuff in Python in order to get the map image?</p>
  
  <p>EDIT: this link appears to contain some pretty relevant info on how Google Maps tiles their maps:
  <a href="http://www.codeproject.com/KB/scrapbook/googlemap.aspx" rel="noreferrer">http://www.codeproject.com/KB/scrapbook/googlemap.aspx</a></p>
  
  <p>also:
  <a href="http://econym.org.uk/gmap/howitworks.htm" rel="noreferrer">http://econym.org.uk/gmap/howitworks.htm</a></p>