Reputation: 89
It seems that Scrapy doesn't display log.info when calling callback. My code:
import scrapy
import re
from array import *
import platform
print("version :"+platform.python_version())
class QuotesSpider(scrapy.Spider):
name = "test"
start_urls = [
'https://www.google.com'
]
def parse(self, response):
self.logger.info("before callback")
scrapy.Request("http://www.google.de", callback=self.parseOther)
self.logger.info("after parseOther")
return
def parseOther(self, response):
self.logger.info("##################parseOther#######################")
return
Maybe the callback is not executed. Any suggestions? Thanks
Upvotes: 0
Views: 50
Reputation: 28226
Creating a Request
is not enough for it to actually be sent.
You need to yield it, just like you would yield items.
yield scrapy.Request("http://www.google.de", callback=self.parseOther)
Upvotes: 1