Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
How can I Fetch a resource which doesn't have all the elements present on page load (using React)?

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!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!