码迷,mamicode.com
首页 > 其他好文 > 详细

爬虫(scrapy中调试文件)

时间:2017-07-29 12:51:09      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:color   bsp   code   创建   abs   class   tin   app   sys.path   

在项目setting同级目录下创建py文件,代码如下:

from scrapy.cmdline import execute
import sys
import os

sys.path.append(os.path.dirname(os.path.abspath(__file__)))
execute(["scrapy","crawl","bole_articles"])

调试运行该文件即可

爬虫(scrapy中调试文件)

标签:color   bsp   code   创建   abs   class   tin   app   sys.path   

原文地址:http://www.cnblogs.com/missmissmiss/p/7255445.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!