TypeError: the JSON object must be str, not 'bytes'

story_data = json.loads(self.request.body)
  • 1

提示TypeError: the JSON object must be str, not ‘bytes’
改为

story_data = json.loads(self.request.body.decode('utf-8'))
  • 1

就好了

你可能感兴趣的:(python3,Scrapy)