Home > Net >  How would I target this tag in puppeteer
How would I target this tag in puppeteer

Time:03-02

I was doing an automation fun project and I choose this website https://agoodmovietowatch.com/ this is a single-page website so to target the sign-up link I inspect and find that this sign-up link is not a

<a>  
tag but an
<h6>  
tag and I cant able to target it, I tried all combinations to select it every class it contains but failed. If someone knows so tell me, please.

here is my code :

await page.waitForSelector("div.tss-1xh7ius-secondaryLinksContainer.MuiBox-root.mui-0 div.text_container__2Nx5h.tss-w9yc2n-secondaryLink.MuiBox-root.mui-0");

await page.click("div.tss-1xh7ius-secondaryLinksContainer.MuiBox-root.mui-0 div.text_container__2Nx5h.tss-w9yc2n-secondaryLink.MuiBox-root.mui-0");

CodePudding user response:

Here is working solution:

const signUpBtn = await page.click(".tss-1xh7ius-secondaryLinksContainer > div")
await signUpBtn.click()
  • Related