xpath自定义属性值的取法
想拿取div 下的 data-platid 的属性值

取法
for data_platid in response.xpath(’//div[@class=“td-item btn-comp”]/@data-platid’).extract()

注:采用 类似html.xpath(’//div[2]/span/@id’) 测试取不到

相关文章:

  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2021-07-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
相关资源
相似解决方案