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

149
Visualizações
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
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