フォームログインを行ってから、scrapy を使用してそのセッションで作業する方法は?
たとえば、ログイン認証があり、ログイン セッションにリンクされた 3 つの異なるページがある Web サイトを考えてみましょう。したがって、scrapy を使用して、最初にログインしてから、ホームページでいくつかをスクレイピングしてから、ホームページで利用可能な特定のリンクをたどり、リンクをクリックしてそのページからスクレイピングします。その後、再びホームページに戻り、別のリンクをたどります。ファイル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