I can't understand where I went wrong, since the class normally returns the id, but the await page.click(final) is not executed, I've been racking my brains for a long time, if anyone can understand the error and could help me I would be grateful.
var str = await page.evaluate(({mudas}) => {
return document.querySelectorAll('[class="container-2sjPya"]')[mudas].id;
},{mudas});
//if(maior>250){
var final = "\'\[id\=\""+str+"\"\]\'";
console.log(name);
console.log(maior);
console.log(posi);
console.log(final);
await page.waitForSelector(final);
await page.click(final);
await page.waitFor(800);
await page.click('[aria-label="Adicionar reação"]');
await page.waitFor(800);
await page.keyboard.press('Enter');
await page.waitFor(1000);
/*}else{
console.log("nenhuma waifu acima de 250 kakera")
}