创建
scrapy startproject demo1
创建
scrapy genspider baidu baidu.com
运行
方法一
scrapy crawl baidu
方法二,
在setting同目录下建立一个main.py
内容
from scrapy.cmdline import execute
execute('scrapy crawl qidian'.split())
然后运行这个就可以启动scrapy
运行 输出
scrapy crawl qidian -o book.csv
scrapy crawl qidian -o book.xml
scrapy crawl qidian -o book.json