Initialize the NPM

npm init
Copy the code

install puppeteer

node demo.js

//demo.js
const puppeteer = require('puppeteer');
(async () => {
  const browser = await puppeteer.launch({
    executablePath: puppeteer.executablePath(),
    headless: false
  });
  var arr = [];
  for (let i = 1; i <= 40; i++) {
    console.log('Catching the first full time master' + i + 'set');
    const targetUrl = `https://goudaitv1.com/play/78727-4-${i}.html`;
    console.log(targetUrl);
    const page = await browser.newPage();
    await page.goto(targetUrl, {
      timeout: 0,
      waitUntil: 'domcontentloaded'
    });
    const baseNode = '.row';
    const movieList = await page.evaluate(sel => {
      var stream = Array.from(
        $(sel)
          .find('iframe#Player')
          .attr('src')); stream && (stream = stream.join(' '));
      returnstream; }, baseNode); arr.push(movieList); page.close(); } console.log(arr); browser.close(); }) ();Copy the code