Skip to content

Instantly share code, notes, and snippets.

@shriyaRam
Created June 23, 2020 09:13
Show Gist options
  • Save shriyaRam/46a0d4d35828a184c5f182aacedb5fdd to your computer and use it in GitHub Desktop.
Save shriyaRam/46a0d4d35828a184c5f182aacedb5fdd to your computer and use it in GitHub Desktop.
connect = '.text-center > a'
await page.waitForSelector(connect).then(()=>{console.log("Success!")}).catch(()=>{console.log("All numbers exhausted!")})
connectlink = await page.$$eval(connect, am => am.filter(e => e.href).map(e => e.href))
await page.goto(connectlink[0]);
connect = '.card-footer > a'
await page.waitForSelector(connect)
connectlink = await page.$$eval(connect, am => am.filter(e => e.href).map(e => e.href))
await page.goto(connectlink[2]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment