0

I was learning about making HTML form which will start Google search on submit and I found out something. When you put tbm=map in the search URL, it downloads something which looks like JSON data.

Example URLs:
https://www.google.com/search?q=abc&tbm=map
https://gist.github.com/ZaifSenpai/7a7abc2cefc08b3e793de00cc605221b

1

1 Answer 1

2

Yes, remove the junk on the first line and remove the last quote and you've got access to a google maps place record in json format!

content=re.sub(r'^.{0,10}\[\[','[[',content)  #remove start
content=re.sub(r'\'$','',content)  #remove end quote
record=json.loads(content)

Not the answer you're looking for? Browse other questions tagged or ask your own question.