pycharm下虚拟环境执行并调试scrapy爬虫程序(一)

 

配置scrapy环境

分别pip install Zope.Interface、Twisted、w3lib、lxml、pyOpenSSL、Scrapy

新建爬虫项目,pycharm运行

我的项目名称为RadioCrawl
文件夹为


Paste_Image.png


新建main.py
from scrapy import cmdline

cmdline.execute("scrapy crawl playlist".split())
表示用命令行的方式执行我的名为playlist的爬虫程序

用pycharm打开项目


Paste_Image.png
打开Edit Configurations

Paste_Image.png
调试

可以在其他代码中设置断点,debug运行


Paste_Image.png
posted @ 2017-10-14 13:42  双鱼男-huangsh  阅读(484)  评论(0编辑  收藏  举报