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

147
Views
How can I get data from a website when everything is loaded?

I've created a quiz that creates a link when you press buttons. This link leads to a shop and the number of products available depends on the link. I need to be able to see in my quiz how many products are available. I have this right now:

(function () {
            require(["jquery"], function ($) {
                $(document).ready(function () {
                    $(btn).click(function () {
                        async function makeRequest() {
                            let response = await fetch('https://myshop.test.nl/shoe.html#' + navi.Link.getLink());
                            // console.log(response.status)
                            if (response.status === 200){
                                console.log('werkt')
                                $("#ProductNumber").load('https://myshop.test.nl/shoe.html#' + navi.Link.getLink() + " span.number-of-items") // the class of the span in which number of products is displayed on the official site
                            }
                        }
                        makeRequest()
                    });
                })
            });
        })();

navi.Link.getLink are all the values of my buttons. So when i put this link in the browser there is always another number of products available. The problem is that the number of problems without the getLink is 350 and it checks the number of products when the site is loaded so it always shows 350 in my quiz. I tried doing this by checking whether th http status is 200, but this doesn't work. I do get the console.log, but the numbeer of products is still 350. How can I change this?

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!