Skip to content

Instantly share code, notes, and snippets.

@chavarera
Created December 23, 2020 04:20
Show Gist options
  • Save chavarera/00909f43cf2d4548eab035a93e90d7ba to your computer and use it in GitHub Desktop.
Save chavarera/00909f43cf2d4548eab035a93e90d7ba to your computer and use it in GitHub Desktop.
scrapy different way to debug scrapy code
#Default debugger
import pdb; pdb.set_trace()
# Use scrapy Logging
self.logger.info('this is Simple Log')
self.log('this is log example')
# Inspect in Shell
from scrapy.shell import inspect_response
inspect_response(response,self)
# Open Response in browser
from scrapy.utils.response import open_in_browser
open_in_browser(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment