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;
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];