Is there a way to get a place from Google Maps using only lng & lat coordinates?

Viewed 87

I'm wondering if there is a way to get a place name, or a place type, or whatever it's called, from Google Maps, using only longitude and latitude coordinates.

I have this URL.

https://www.google.com/maps/place/@42.34,-71.10

In Google Maps I see this.

enter image description here

The closest thing to the red marker is Simmons University, but Simmons University is NOT in the URL. If I click the text that says 'Simmons University', I get this URL.

https://www.google.com/maps/place/Simmons+University/@42.34,-71.1021887,17z/data=!4m13!1m7!3m6!1s0x0:0x0!2zNDLCsDIwJzI0LjAiTiA3McKwMDYnMDAuMCJX!3b1!8m2!3d42.34!4d-71.1!3m4!1s0x89e379f7e743c9c5:0xa77a577bc7bd4396!8m2!3d42.339063!4d-71.1004376

Now, Simmons University is in the URL. Is there some way to extract the text of whatever is closest to the red marker?

I hacked this code together.

from selenium import webdriver
from time import sleep
driver = webdriver.Chrome('/home/datafiles/chromedriver')
driver.get('https://www.google.com/maps/place/@42.34,-71.10')
sleep(2)

I'm getting this error.

WebDriverException: Message: 'chromedriver' executable may have wrong permissions.

The environment is actually Linux and I'm using Python in a Jupyter Notebook. I've never used Linux before.

2 Answers

Since there are special characters in your URL instead of

driver.get('https://www.google.com/maps/place/@42.34,-71.10')

Try this:

driver.get(r'''https://www.google.com/maps/place/@42.34,-71.10''')

short answer - no. It's canvas and need other tools for that

Related