NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
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 * * * * *