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

135
Views
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 answers
Answer question

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 Report
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!