【发布时间】:2016-11-14 04:06:20
【问题描述】:
我想在 Python 中抓取包含 JSON 数据的 Javascript 行。例如:
AH4RSearch.listingsJSON = $.parseJSON('{"properties":[{"Price":3695,"PriceFormatted":"3,695","Street":"9251 E Bajada Road"}');
我知道在我可以得到$.parseJSON 的内容后,我可以使用json.loads 将其存储为JSON 格式,但是我如何从Javascript 行获取这些内容?
【问题讨论】:
-
它只是字符串/文本,所以请使用标准字符串函数,如
split()和切片[start:end]
标签: javascript python json web-scraping