python - 元素的选择器(CSS 或 Xpath)

标签 python html css xpath scrapy

http://www.dickssportinggoods.com/p/puma-mens-evospeed-35-leather-fg-soccer-cleats-16pummvspd35lthfgnth/16pummvspd35lthfgnth?&color=White/Orange&Clearance=true

我想获得“防滑钉”元素,如下图所示: enter image description here

我失败的尝试:

response.xpath('.//*[@class="cat-breadcrumb"]/span/@itemprop').extract_first()
'item'

提前致谢

最佳答案

'normalize-space(id("WC_BreadCrumb_Link_4")/span/text())'

关于python - 元素的选择器(CSS 或 Xpath),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42602706/

相关文章:

Python单元测试-可能会一直失败直到通过吗?

python - 从字典创建饼图并更改箭头

php - 使用 rowspan PHP 创建动态表

html - 如何更改数据表中排序箭头的颜色

css - 打印中的 Angular4 : How to include test. component.css

html - landingspage 的 CSS 不断被覆盖?

python - 使用 polipo 和 tor 与 python mechanize 浏览器显示一个站点上的 IP,而不是另一个站点上的 IP

python - 向 Telegram 发送图像时出现 'Request Entity Too Large' 错误是什么原因?

html - 如何隐藏 pandas <1.4 中的索引级别

html - React Router 只有一个链接可以工作 Github Pages