How to use PyCharm to debug Scrapy projects

Create a Python file on crawler folder on your project. I used

  • Project
    • Crawler
      • Crawler
        • Spiders
      • scrapy.cfg

Inside your put this code below.

from scrapy import cmdline    
cmdline.execute("scrapy crawl spider".split())

And you need to create a “Run Configuration” to run your

Doing this, if you put a breakpoint at your code it will stop there.

Excluding indexed directories in PyCharm

Since a while I am using the PyCharm Community Edition to expiriment with Python, but have been struggling with long startup times. This happens because of some Python package storing loads of httpcache on disk.


Here is how you can exclude these files and directories from the project that you are working on and speed up the startup process of Python:

  • Open Python;
  • Click File;
  • Click Settings;
  • Click on Project XYZ;
  • Select the folders to exclude.

You can download PyCharm (for Windows) here.