第三百四十节,Python分布式爬虫打造搜索引擎Scrapy精讲—css选择器
css选择器
1、
2、
3、
举例:
# -*- coding: utf-8 -*- import scrapy class PachSpider(scrapy.Spider): name = ‘pach‘ allowed_domains = [‘blog.jobbole.com‘] start_urls = [‘http://blog.jobbole.com/all-posts/‘] def parse(self, response): asd = response.css(‘.archive-title::text‘).extract() # print(asd) for i in asd: print(i)
时间: 2025-01-24 14:43:42