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

128
Visualizações
Trying to select a dom item on a page built by React with JS console

Using the script with Tampermonkey (a user script manager), I am trying to select an HTML element after the page has been rendered. This is a live site that is not my own.

I inspected the source code and can see there is a "React developer tools" folder and a "webpack" folder.

It seems I am only able to select the elements I want when I select said HTML elements with the dev tools and then target it with javascript. I need a way to do this solely through script.

Here is the code I am using.

(function() {
    'use strict';
    // Your code here...
if (location.href === "https://annotate.appen.com/")
{
    function jobFunction() {
      let anchorSearch = () => {
        let theLink = document.querySelector("td > a");
        if (!theLink) {
          console.log("second check")
          location.reload(true);
        }
        else {
          return
        }
      };
      console.log("first check")

      function checkDom (){
        let tableDom =document.querySelector('td');
          if (tableDom) {
            console.log("Dom Loaded, starting check")
          anchorSearch()
          }
          else {
            console.log('checking dom..')
            setInterval(checkDom, 5000)
        }
      }
      checkDom()
    }
    jobFunction();

  }
})();
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