Convert Google results object (pure js) to Python object

后端 未结 3 1057
逝去的感伤
逝去的感伤 2021-01-15 02:45

So I\'m trying to use Google Map suggest API to request place name suggestions. Unfortunately I can\'t find the docs for this bit.

Here is an example URI:

ht

3条回答
  •  再見小時候
    2021-01-15 03:20

    I would try to poke around in order to get JSON, but failing that there's this little monstrosity which someone will inevitably yell at me about:

    class Iden(object):
      def __getitem__(name, index):
        return index
    
    notjson = '{...}'
    
    data = eval(notjson, {}, Iden())
    

提交回复
热议问题