How to click on text in Puppeteer?


Is there any method (didn’t find in API) or solution to click on element with text?

For example I have HTML:

<div class="_5THWM1">flex
<span class="_2i7N3j">Sort By</ span>
<div class="_10UF8M 3LsR0e>Relevance</div>
<div class="_10UF8M">Popularity</div>
<div class-"_10UF8M'>Price -- Low to High</div>
<div class="_10UF8M>Price -- High to Low</div>
<div class="_10UF8M" >Newest First</div>
</div>

I want to click on Price — Low to high but with the same classes I don’t know how to click and I don’t know how to click on text. Can anyone help me with this, please?

I am using Puppeteer and please write code to this.

Source: CSS – Stack Overflow

November 22, 2021
Category : News
Tags: Automation | css | html | javascript | puppeteer

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.