🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
1.创建项目 * * * * * **`scrapy startproject tutorial`** tutorial为项目名称,可自行修改 这将创建一个tutorial包含以下内容的目录: tutorial/ scrapy.cfg # deploy configuration file tutorial/ # project's Python module, you'll import your code from here __init__.py items.py # project items definition file middlewares.py # project middlewares file pipelines.py # project pipelines file settings.py # project settings file spiders/ # a directory where you'll later put your spiders __init__.py * * * * * 创建项目 scrapy genspider mydomain mydomain.com * * * * * 2.运行爬虫 转到项目顶级目录下运行 `scrapy crawl spider_name` * * * * * scrapy shell "http://quotes.toscrape.com/page/1/" * * * * * scrapy crawl quotes -o quotes.json * * * * *