ns = {"re": "http://exslt.org/regular-expressions"}
print(html.xpath("//*[re:match(text(), 正则表达式)]/text()", namespaces=ns))

是有关命名空间namespace的知识,之前在文档中找到的答案,现在不知道为什么打不开官网,无法指出具体出处。

相关文章:

  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-08-20
  • 2021-12-22
  • 2021-10-24
  • 2022-12-23
  • 2021-05-16
猜你喜欢
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2021-04-26
  • 2021-07-09
  • 2022-12-23
  • 2021-12-07
相关资源
相似解决方案