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

scrapy启动

时间:2019-07-02 09:23:29      阅读:98      评论:0      收藏:0      [点我收藏+]

标签:class   lse   key   项目   存储   level   head   opera   pen   

 

创建项目

在开始爬取之前,您必须创建一个新的Scrapy项目。 进入您打算存储代码的目录中,运行下列命令:

scrapy startproject scrapytest
第一种
scrapy genspider example example.com
第二种
scrapy genspider -t crawl example example.com
?
from scrapy.cmdline import execute
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
execute([‘scrapy‘,‘crawl‘,‘example‘])  
#example 为上图中的name
LOG_LEVEL = ‘INFO‘
LOG_ENABLED=False

scrapy启动

标签:class   lse   key   项目   存储   level   head   opera   pen   

原文地址:https://www.cnblogs.com/ellisonzhang/p/11118394.html

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