Quantcast
Viewing all articles
Browse latest Browse all 9

Answer by fmagno for Debugging Scrapy Project in Visual Studio Code

  1. Inside your scrapy project folder create a runner.py module with the following:

    import osfrom scrapy.cmdline import executeos.chdir(os.path.dirname(os.path.realpath(__file__)))try:    execute(        ['scrapy','crawl','SPIDER NAME','-o','out.json',        ]    )except SystemExit:    pass
  2. Place a breakpoint in the line you wish to debug

  3. Run runner.py with vscode debugger


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>