[英]XPath select on child nodes
我目前正在嘗試在子節點上創建新的xpath。 但這是行不通的。
我該如何存檔?
這個想法是:
xpath.select('//*[contains(@class, "product-grid__item")]', doc).forEach(node => {
node = node as Node;
xpath.select('/a /*[contains(@class, "desc-height")] /strong', node).forEach(z => {
z = z as Node;
console.log(z.textContent);
})
})
但是第二個請求不在節點上選擇,而是在文檔上選擇。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.