Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

144
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda