Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda