ImportError: Unable to import name ScrapyFileLogObserver

I am trying to check the ScrapyFileLogObserver log. In my original code, I installed the package correctly to use:

from scrapy.log import ScrapyFileLogObserver

but i have this error when i run my spider:

from scrapy.log import ScrapyFileLogObserver

ImportError: Unable to import name ScrapyFileLogObserver

for information i am using the latest scrapy (Scrapy 1.0.1). How can I fix my mistake?

+3


source to share


1 answer


In 1.0, the Scrapy Logging System was completely rewritten , no longer ScrapyFileLogObserver

. Instead, Scrapy now uses curled directlyPythonLoggingObserver

:



observer = twisted_log.PythonLoggingObserver('twisted')
observer.start()

      

+6


source







All Articles