擅长:python、mysql、java
<p>这与对html响应使用Scrapy的<code>HtmlXPathSelector</code>相同。唯一的区别是您应该使用<code>json</code>模块来分析响应:</p>
<pre><code>class MySpider(BaseSpider):
...
def parse(self, response):
jsonresponse = json.loads(response.body_as_unicode())
item = MyItem()
item["firstName"] = jsonresponse["firstName"]
return item
</code></pre>
<p>希望能有所帮助。</p>