但是,当循环遍历项目列表时,请求相对xpath将返回整个页面的所有匹配项目。我一直在使用0.24,但是升级到最新的版本(1.0)也会遇到同样的问题。for sel in response.xpath('//ul[@class="items"]//div[@class="item"]'): item['id'] = sel.
我正在尝试使用Python中的Scrapy库从至尊社区网站上获取标题、价格和向上/向下投票的统计数据。for data in response.css('div.card-details'): 'title': data.xpath'price': data.css('span.label-price::text').get()
#
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="main"]/footer/div[1]/div[2]/div/div[2]"}
我想要更新xpath: