📜  使用 xpath 获取 DOM 节点 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:22.028000             🧑  作者: Mango

代码示例2
const xpath = require("xpath-html");
const node = xpath.fromPageSource(html).findElement("//*[contains(text(), 'with love')]");
// There is a library xpath-html that can help you using XPath to query HTML, with minimal efforts and lines of code.
// https://github.com/hieuvp/xpath-html