Skip to content

Instantly share code, notes, and snippets.

@posaunehm
Last active August 23, 2018 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save posaunehm/b68b10e9340c3b693617278409bf3ace to your computer and use it in GitHub Desktop.
Save posaunehm/b68b10e9340c3b693617278409bf3ace to your computer and use it in GitHub Desktop.
Puppeteer recorder demo
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
const navigationPromise = page.waitForNavigation()
await page.setViewport({ width: 1920, height: 1103 })
await page.goto('https://www.yahoo.co.jp/')
await page.click('form > #srchfield > #srchbd > p > #srchbtn')
await navigationPromise
await page.click('#WS2m > .w:nth-child(1) > .hd > h3 > a')
await navigationPromise
await page.click('.js-repo-meta-container > .js-repo-meta-edit > .col-11 > span > a')
await navigationPromise
await browser.close()
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment