1

I need to click this button by selecting it from the inner text and not by the class.

 <a class="name-link" href="/shop/...">Green Sweater</a> 

this is what i tried

await page.click('a[innerText="Green Sweater"]', elem => elem.click());

this is the error i get:

UnhandledPromiseRejectionWarning: Error: No node found for selector: a[innerText="Green Sweater"]

is it possible to get this selection also by using one of the words? for example, instead of Green Sweater, will it work even if i select it by searching only Green?

Paolo
  • 23
  • 1
  • 6

0 Answers0