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

138
Vistas
Waiting for site to load before fetching content

Using cors anywhere, I am fetching a site which needs to load in a module of information - such as avaliable domain names. However, fetch works by waiting until the website loads before returning a fulfilled promise, although this doesn't mean that the site can load more data even after the site has finished loading.

Simply, I'm trying to fetch a domain search website and see what domains are available, when the promise returns (with the HTML body contents), I strip only the necessary data such as if a domain is available and display it in my site.

Therefore, is it possible to establish a connection to a website, then afterward, wait an additional 10 more seconds before returning the new content that the site I am fetching to load in?

Here is my current code

async function accessURL(website) {
    let response = await fetch('https://corsanywhereexample.com/'+website);
    return await response.text();
}

await accessURL('www.example.com/content').then(text => document.body.innerHTML = text);

Based on the code above, using my own cors anywhere nodejs server, it successfully fetches the website HTML, where I can display on my site, however, the site is incomplete, as it was still loading in data from the server (which wasn't returned inside the fetch)

Is there potentially something like this which could wait 10 seconds before returning any new information in the site?

async function accessURL(website) {
    let response = await fetch('https://corsanywhereexample.com/'+website);
    return new Promise(resolve => setTimeout(() => { await response.text() }, 10000))
}

await accessURL('www.example.com/content').then(text => document.body.innerHTML = text);
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