contains
xpath(‘//div[contains(@class,"xxx")]‘)
normalize-space
xpath(‘normalize-space(//div[@class="xxx"])‘)
xpath(‘starts-with(@name,"xxx")‘)
xpath(r‘//*[re:match(@id,"img_\d+")]‘, namespaces={"re": "http://exslt.org/regular-expressions"})
parent::a
xpath(‘./a/span[@class="refinement-category"]/parent::a/@href‘)
原文:https://www.cnblogs.com/carl-/p/14691193.html