Loading

scrapy启动

 

创建项目

在开始爬取之前,您必须创建一个新的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
posted @ 2019-07-02 09:02  Ellisonzhang  阅读(254)  评论(0编辑  收藏  举报