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

145
Visualizações
get the random generated string in javascript function from website

I want to do website scraping however the there is a random generated string added to the reactEventHandlers, Please look below code, there is a reactEverHandle$ followed by a string which is randomly generated. I found the function (second code)which generates it and wondering how can I get the same generated string once I run my js.file?

document.getElementsByClassName("ProductReviewCustomerInfo-name")[0].__reactEventHandlers$nt3qerm8wcb

 var Tn = Math.random().toString(36).slice(2)
      , xn = "__reactInternalInstance$" + Tn
      , Pn = "__reactEventHandlers$" + Tn
      , _n = "__reactContainere$" + Tn;

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This might work for you.

I'm extracting all keys and then running a simple regex check to match your random generated key.

let keys = document.getElementsByClassName("ProductReviewCustomerInfo-name")[0].keys();
const regex = /^(__reactEventHandlers\$\w+)$/gm;
let your_key = keys.find(x => regex.test(x));
console.log(your_key);
let value = document.getElementsByClassName("ProductReviewCustomerInfo-name")[0][key];
about 4 years ago · Juan Pablo Isaza Relatório
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