假如拿到的代理是这样,36.138.48.132|16790|9953|0650
const puppeteer = require('puppeteer');
async function launch(){
const browser = await puppeteer.launch({
headless: false,
args: [
'--disable-web-security',
`--proxy-server=36.138.48.132:16790`
]
});
const page = await browser.newPage();
await page.authenticate({
username: '9953',
password: '0650'
})
await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36")
await page.goto('https://pages.ximalaya.com/mkt/act/3e393435a02522d3');
}
launch().catch(err=>console.log(err))
结果: