Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Gabotronix's avatar

Puppeteer.js : get href attribute of link with given text

Hi everybody, is there a way in puppeteer to get the href attribute of an anchor element with text "See more".

I want to grab the href attribute of an element like this:

<a href="/this-is-what-i-want">See more</a>

maybe it's possble to do with eval?

0 likes
1 reply

Please or to participate in this conversation.