我正在尝试在Python中使用Google的AJAX (JSON) Web搜索API。我被卡住了,因为Python的urllib.urlencode()只接受值对,而不是字符串本身进行编码。在Google的API中,查询字符串是搜索词,它与变量没有关联。query = "string that needs to be encoded"
params = urllib.urlencode(query
While trying to debug, I put this in:print jsonurl
# Was hoping text would contain the actual jsoncrap from the URL, but seems not...text = json.loads(jsonurl)我想要做的就是将我在Firefox中加载的{{.我用谷歌搜索了很多次,但我还没有找到一个好的答案,那就是如何将以.json结尾的网址中的{{...}}内容转换为Python</e