everlasting_188-java从业者

朝花夕拾,关注数据库,Java、大数据和互联网金融

如何在pycharm中调试scrapy

 

引用:https://stackoverflow.com/questions/21788939/how-to-use-pycharm-to-debug-scrapy-projects

 

The scrapy command is a python script which means you can start it from inside PyCharm.

When you examine the scrapy binary (which scrapy) you will notice that this is actually a python script:

#!/usr/bin/python

from scrapy.cmdline import execute
execute()

This means that a command like scrapy crawl IcecatCrawler can also be executed like this: python /Library/Python/2.7/site-packages/scrapy/cmdline.py crawl IcecatCrawler

Try to find the scrapy.cmdline package. In my case the location was here: /Library/Python/2.7/site-packages/scrapy/cmdline.py

Create a run/debug configuration inside PyCharm with that script as script. Fill the script parameters with the scrapy command and spider. In this case crawl IcecatCrawler.

Like this:

 

PyCharm Run/Debug Configuration

说明:

1、script设为使用cmdline.py启动

2、命令行为启动的参数

3、工作区设置为项目工作区

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/everlasting_188/article/details/80320757
个人分类: ---自然语言处理
想对作者说点什么? 我来说一句

如何用PyCharm运行Scrapy

oLevin oLevin

2016-07-26 21:09:05

阅读数:3634

没有更多推荐了,返回首页

不良信息举报

如何在pycharm中调试scrapy

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭