extracting a json response in scrapy
From the example given, it should be like this:
item["url"] = jsonresponse["records"][0]["uri"]item["Name"] = jsonresponse["records"][0]["name"]
EDIT:
To get all uri
s and name
s from the response, use this:
def parse(self, response): ... for record in jsonresponse["records"]: item = ApiItem() item["url"] = record["uri"] item["Name"] = record["name"] yield item
Note particularly replacing return
with yield
.