2016-08-15 36 views

回答

1

我还没有运行的代码,但创建Item实例肯定需要是for循环中:

... 

    def parse(self, response): 
     jsonresponse = json.loads(response.body_as_unicode()) 
     topic = jsonresponse['posts'] 
     for post in topic: 

      service = ProducthuntItem() 

      service['name'] = post['name'].replace(";", " ") 
      ... 
+0

当然!看起来这是实际的问题。我会测试它,并在今天晚些时候接受。 谢谢。 – svgrafov