Hi. I am writing my first extension. Basically, I want to screen scrape a webpage and read data to generate a URI. I’ve tried a lot of things and then I broke it down to basics. There are three commands that work fine in the console. Really, it’s just an “evaluate” with an XPath that gets an element, an iterateNext to get the element, and a textContent to read the value. Here are the actual commands:
let td = document.evaluate("//*[@id='ride-1286927']/td[@class='pickup-location']", document, null, XPathResult.ANY_TYPE, null)
let td1 = td.iterateNext()
td1.textContent
However, in my JavaScript for the extension it fails It’s the iterateNext that fails by returning null.
Any ideas? I’m getting frustrated.