How to use PyCharm to debug Scrapy projects

后端 未结 10 1440
长发绾君心
长发绾君心 2020-12-02 04:00

I am working on Scrapy 0.20 with Python 2.7. I found PyCharm has a good Python debugger. I want to test my Scrapy spiders using it. Anyone knows how to do that please?

<
10条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 04:40

    I use this simple script:

    from scrapy.crawler import CrawlerProcess
    from scrapy.utils.project import get_project_settings
    
    process = CrawlerProcess(get_project_settings())
    
    process.crawl('your_spider_name')
    process.start()
    

提交回复
热议问题