我试图刮除本页的主要标题:https://patents.google.com/patent/CN102093389B/en (“双链氧桥杂环阿纳巴辛化合物及其制备方法”)与刮除,这是不可能的。我正在尝试用css提取它。同样的css选择器在木偶师工作很好,并提取主标题,但在刮除没有任何。代码是这样写的
import scrapy
class GooglepatentsspiderSpider(scrapy.Spider):
name = 'googlePatentsSpider'
allowed_domains = ['patents.google.com']
start_urls = ['https://patents.google.com/patent/CN102093389B/en']
def parse(self, response):
title = response.css('h1#title::text').get()
yield {
'title': title
}发布于 2021-07-22 09:52:03
css路径不正确。试试这个,response.css('span[itemprop="title"]::text').get()
https://stackoverflow.com/questions/68481903
复制相似问题