dissabte, 30 de març del 2024

Retrieve plain text from website - from xpath pointer

 const element = document.evaluate("//*[@id='__next']//div", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
const innerText = element ? element.innerText : "Element not found";
console.log(innerText);


Cap comentari:

Publica un comentari a l'entrada