1)环境是 Anaconda ,conda package包可查看https://conda-forge.github.io/
scrapy可通过https://anaconda.org/conda-forge/scrapy下载安装包。
也可直接>conda install -c conda-forge scrapy安装
参考:https://doc.scrapy.org/en/latest/intro/install.html
2)也可通过下载Scrapy-1.4.0-py2.py3-none-any.whl,然后pip安装>pip install Scrapy-1.4.0-py2.py3-none-any.whl;
有依赖库Twisted-17.1.0-cp27-cp27m-win_amd64.whl;
也可直接>pip install Scrapy安装(注意Scrapy大小写敏感)
安装指南:http://scrapy-chs.readthedocs.io/zh_CN/0.24/intro/install.html#scrapy3、爬虫代码示例:
import scrapy class BlogSpider(scrapy.Spider): name = 'blogspider' start_urls = ['https://blog.scrapinghub.com'] def parse(self, response): for title in response.css('h2.entry-title'): yield {'title': title.css('a ::text').extract_first()} for next_page in response.css('div.prev-post > a'): yield response.follow(next_page, self.parse 入门教程:http://scrapy-chs.readthedocs.io/zh_CN/0.24/intro/tutorial.html