Convert Google results object (pure js) to Python object

后端 未结 3 1087
逝去的感伤
逝去的感伤 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:02

    import demjson
    demjson.decode(google.js)
    

    I found this when trying to parse Google Finance option "JSON" data, which, as many note, isn't JSON-compliant.

    demjson saved me writing an obnoxious regex string; it just works.

提交回复
热议问题