Capture embedded google map image with Python without using a browser

前端 未结 8 1131
心在旅途
心在旅途 2020-12-04 18:57

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)

The image size can be

8条回答
  •  生来不讨喜
    2020-12-04 19:15

    urllib.urlopen will open a URL, the result will have a .read() method you can use to get the image bytes. cStringIO has a file-like object based on a string in memory. PIL has an Image.open function that opens a file-like thing to give you an image object. Image objects can be asked about their pixel values.

提交回复
热议问题