Reputation: 11
hello I need a method to click with puppeteer on a button that has an identical class to others but different text inside the problem is that this text is identical to others on the page so in short I need a way to click on a button with a text below a specific class. is there any way? I hope I have explained, thanks
my code at the moment :
await page.click ("._0xLoFW.FCIprz")
html :
<div class="_0xLoFW FCIprz"><span class="_7Cm1F9 ka2E9k uMhVZi dgII7d z-oVg8 pVrzNP">40</span></div>
Upvotes: 1
Views: 991
Reputation: 13782
You can try XPath:
const [element] = await $x("//div[@class='_0xLoFW FCIprz'][.='40']");
await element.click();
Upvotes: 1