zuqiu.py 743 B

12345678910111213141516171819202122232425
  1. # from twisted.internet import defer,reactor
  2. # from ..utils.helper import Helper
  3. class ZuqiuPipeline(object):
  4. def open_spider(self, spider):
  5. pass
  6. # @defer.inlineCallbacks
  7. # def process_item(self,item,spider):
  8. # out=defer.Deferred()
  9. # reactor.callInThread(self._do_calculation,item,out)
  10. # yield out
  11. # def _do_calculation(self,item,out):
  12. # pass
  13. def process_item(self, item, spider):
  14. all = item['all']
  15. team_h, team_c = all['team_h'], all['team_c']
  16. league, league_id = all['league'], all['league']
  17. datetime, re_time = all['datetime'], all['re_time']
  18. match_id = all['gid']
  19. print(league, team_h, team_c, datetime, match_id, league_id)