Puppeteer, device case for setting up a browser.
const puppeteer = require('puppeteer'); const devices = require('puppeteer/DeviceDescriptors'); const iPhone = devices['iPhone 6']; (async () => {const browser = await (puppeteer.launch({// set timeout: // This property ignores the HTTPS error ignoreHTTPSErrors: true, devtools: true, headless: false, args: ['--no-sandbox'] })); const page = await browser.newPage(); // Set the emulate iPhone 6 await page.emulate(iPhone); // open m home page await page.goto('https://m.leka.club/sub_card/card_purcotton.html'); / /... }) ();Copy the code
Install puppteer dependencies
npm config set puppeteer_download_host=https://npm.taobao.org/mirrors
Copy the code
Or with CNPM