这与使用Scrapy的
HtmlXPathSelectorhtml响应相同。唯一的区别是你应该使用
json模块来解析响应:
class MySpider(baseSpider): ... def parse(self, response): jsonresponse = json.loads(response.body_as_unipre()) item = MyItem() item["firstName"] = jsonresponse["firstName"]return item
希望能有所帮助。



