json - How do I create sub item of sub item in scrapy spider -


i have tried below code:

item2['id'] = data['id'] item['content'].append(item2) yieldrequest(url='abc.json?',meta={'item':item,'item2':item2},callback=self.get_details)  def get_details(self, response)     item = response.meta.get('item')     yield item 

but if want create item3 , store item3 data in item2 below structure code not working.

how can pass both item , item2 in meta can make array item2 well.

required data structure:

[{  id": 18, "totalseason": 2, "seasons": [{     "season": "1",     "title": "season1",     "totalepisodes": 6,         "episodes": [{             “title”: “xyz”             “id”: 103}]            }] }] 


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -