xpath中匹配正則表達式

etree = lxml.html.fromstring(html) ns = {"re": "http://exslt.org/regular-expressions"} etree.xpath("//div[re:match(@class,'<正則表達式>')]", namespaces=ns) 用正則表達式匹配有規律的某種屬性html
相關文章
相關標籤/搜索