0

私はファイルccbank_spider.pyを持っています、以下は内容です

class LoginSpider(BaseSpider):

 #some code

 #for hitting and parsing of the Account URL
 for accountURL in (strip(s) for itemArr in items for s in itemArr['accountURL']):
    print accountURL
    yield request(accountURL, callback=self.account_transactions)

 def account_transactions(self, response):
  print 'print text'
  return None

以下のエラーが発生します

          File "D:\NextGen\workspace\tutorial\tutorial\spiders\ccbank_spider.py", line       45, in after_login
       yield request(accountURL, callback=self.account_transactions)
   exceptions.TypeError: 'module' object is not callable
4

1 に答える 1

1
          File "D:\NextGen\workspace\tutorial\tutorial\spiders\ccbank_spider.py", line       45, in after_login
       yield request(accountURL, callback=self.account_transactions)
   exceptions.TypeError: 'module' object is not callable

It should be Request not request, having that you did from scrapy.http import Request

于 2012-07-19T05:07:57.423 に答える