Last active
July 12, 2018 03:56
-
-
Save bambooom/2669e8d629eb0d49988c3c884061fcb5 to your computer and use it in GitHub Desktop.
select option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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