Created
May 3, 2018 17:10
-
-
Save senthilmpro/101f90f9ae0d499ff6a6e7c8c214d5f6 to your computer and use it in GitHub Desktop.
Replace HTML Selector inner text/ content via Google Puppeteer script
This file contains 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
async function setSelectVal(sel, val) { | |
await page.evaluate((data) => { | |
// this innerHTML can be replaced with .value (based on HTML type) | |
return document.querySelector(data.sel).innerHTML = data.val; | |
}, {sel, val}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment