Skip to content

Instantly share code, notes, and snippets.

@bambooom
Last active July 12, 2018 03:56
Show Gist options
  • Save bambooom/2669e8d629eb0d49988c3c884061fcb5 to your computer and use it in GitHub Desktop.
Save bambooom/2669e8d629eb0d49988c3c884061fcb5 to your computer and use it in GitHub Desktop.
select option
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://test-navlang-demo-vvkpjvrhym.now.sh');
await page.setViewport({ width: 1380, height: 900 });
await page.waitFor(1000);
// use elementHandle.type
const selectElem = await page.$('select[name="choose1"]');
await selectElem.type('Value 2');
// use page.select
await page.select('select[name="choose2"]', 'val3');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment