I've looked through the Fetch API documentation and tried googling the heck outta this but wasn't able to come up with answers.
I'm trying to fetch a webpage which is using react.
Example code:
async function fetchReactWebpage(){
let f = await fetch('https://example.com')
let r = await f.text()
let parse = new DOMParser()
let doc = parse.parseFromString (r, "text/html");
console.log('doc',doc)
doc.querySelector('#app-root').innerHTML.length
// output = 0
// (it's empty)
}
Given that the app-root element (e.g. <div id="app-root"</div>) is where all the content is rendered, is there a way to use fetch or anything else to retrieve the content in that div AFTER it's rendered?
TIA!