Skip to content

Instantly share code, notes, and snippets.

@manuzhang
Created July 23, 2019 23:41
Show Gist options
  • Save manuzhang/927300a69ca04926ce27f4b2704450f9 to your computer and use it in GitHub Desktop.
Save manuzhang/927300a69ca04926ce27f4b2704450f9 to your computer and use it in GitHub Desktop.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
args: [
'--proxy-server=http://127.0.0.1:1087'
]
});
for (const url of process.argv.slice(2)) {
const page = await browser.newPage();
await page.goto(url, {waitUntil: 'networkidle0'});
const duration = await page.$eval('#audioplayer', el => el.duration);
console.log(duration);
}
await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment