所以,我使用了一个小python脚本来简单地打印出一个网站的每一次西北大厅.,其中通配符()是一个数字,位于从url中提取的非常大的json字符串中。在
到目前为止,我有这个: 导入urllib,json,re
url = 'http://graphite.website.com/render/?target=stats.web.northwest.hall.*&format=json'
response = urllib.urlopen(url)
data = json.loads(response.read())
code = re.findall('northwest', data)
print code
这应该返回30个正则表达式的列表西北大厅号在正在解析的json字符串中,但我得到了以下错误:
^{pr2}$Python新手(当然你能看出来)。 提前谢谢。在
使用
从服务器获取json字符串。在
使用
^{pr2}$将这个字符串转换成python字典。在
编辑:
相关问题 更多 >
编程相关推荐