0
我想提取的跨度標籤是這樣的:提取一個<span>標籤包含文本
<span>Price: $500</span>
這有什麼錯doc.xpath('//span[@contains(text(), "Price")]/text()')
?
這是說這是一個無效的表達式。
我想提取的跨度標籤是這樣的:提取一個<span>標籤包含文本
<span>Price: $500</span>
這有什麼錯doc.xpath('//span[@contains(text(), "Price")]/text()')
?
這是說這是一個無效的表達式。
試試這個:
//span[starts-with(name(), 'Price')]/text()
或
//span[starts-with(., 'Price')]/text()
或
//span[contains(., 'Price')]/text()
或
//span[contains(name(), 'Price')]/text()