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

137
Views
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
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!