Skip to content
Advertisement

how to select span with specific email attribute value with Puppeteer

using Puppeteer trying to search in my email page for recent emails that contain specific (“email” in my case) attribute or by the text value at least

<span  email="noreply@example.com" name="Moon">Moon</span>

Advertisement

Answer

Using $:

const ele = await page.$('span[email="noreply@example.com"]');
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement