import scrapy
class QuotesSider(scrapy.Spider):
name = 'quotes'
start_urls = [
'https://parade.com/937586/parade/life-quotes/'
]
def parse(self, response, **kwargs):
quote = response.css('p::text').extract()
yield {'text': tittle}-- how to find element ?
我不知道如何深入抓取和查找元素..只是一些基础知识,我想抓取给定url上方的所有150个引号..我在开发人员工具中找不到元素..url中至少有一个引号,有人能推荐我吗。。?URL=https://parade.com/937586/parade/life-quotes/
刮壳:
所以您需要
response.css('p:nth-child(n+6)::text').getall()
getall()
返回一个列表,而get()
和extract()
只返回第一个数据您的代码必须如下所示:
相关问题 更多 >
编程相关推荐