python3爬虫一

时间:2022-04-20 23:18:44

1、环境安装:

在py3env(虚拟环境)下安装scrapy,新建项目:

pip install scrapy
scrapy startproject ArticleSpider cd ArticleSpider/ scrapy genspider jobbole blog.jobbole.com

2、scrapy shell:

在py3env(虚拟环境)下:

scrapy shell http://blog.jobbole.com/112744/

3、css选择器:

response.css('.entry-header h1::text').extract()

python3爬虫一

python3爬虫一

python3爬虫一