get DOM node with xpath
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
// *** use ***
// getElementByXpath(XpathTargetingDOMNode)
get DOM node with xpath
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
// *** use ***
// getElementByXpath(XpathTargetingDOMNode)
xpath nodejs
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us