_ntes_stocksearch_callback([{"type":"SZ","symbol":"000001","name":"a","spell":"PAYH"},{"type":"SH","symbol":"000001","name":"b","spell":"SZZS"},{"type":"FN","symbol":"000001","name":"c","spell":"HXCZHH"}])
如何编写正则表达式模式以获得如下结果:
{"type":"SZ","symbol":"000001","name":"a","spell":"PAYH"},
{"type":"SH","symbol":"000001","name":"b","spell":"SZZS"},
{"type":"FN","symbol":"000001","name":"c","spell":"HXCZHH"}
更新:
我从一个 url 中删除了一些东西,我想让输出可以用函数 json.loads() 处理,那么我该怎么办?
import urllib2
convert_url = "http://quotes.money.163.com/stocksearch/json.do?type=&count=10&word=000001"
req = urllib2.Request(convert_url)
html = urllib2.urlopen(req).read()
html = html.decode("gbk").encode("utf-8")
print html