I'm accessing a webpage via headless chrome that should be running a script to append a few elements to the DOM. However, I can't figure out a way to get ahold of these elements
Trying to access them via DOM.querySelector within my Page.loadEventFired callback gives me nothing. I thought maybe this was because the script to append them hadn't finished executing by the time the querySelector was run, so I tried attaching a handler to the DOM.childNodeInserted event (both in the context of Page.loadEventFired and before navigating to the page) as follows:
DOM.childNodeInserted((params) => {
console.log("we have a child!!");
});
But the event never fires. My next approach was the DOM.setChildNodes event combined with DOM.requestChildNodes on the container elements for the inserted elements. I execute DOM.requestChildNodes within Page.loadEventFired. This event fires successfully, but reports no child nodes.
At this point, I'm confused as to whether the script is even running. Can anyone offer some advice?