Created
July 23, 2019 23:41
-
-
Save manuzhang/927300a69ca04926ce27f4b2704450f9 to your computer and use it in GitHub Desktop.
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
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