Also do not know how to make ~~ directly on the code ha ha ha ~~~

Step 1: Create a netflixcorone.js file

Step 2: Introduce key dependencies to download Puppeteer based on NPM package management

npm install puppeteer –save

Next we’ll write the crawler to netflixcorone.js:

/ / into the puppeteer

const puppeteer = require(‘puppeteer’)
// Fs has a write/read function
const fs = require(‘fs’)

// crawler logic

async function scrape (url) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url)
var movies = await page.evaluate(() => {
// This is the page p tag
var titlesList = document.querySelectorAll(‘p’);
var movieArr = [];
for (var i = 0; i < titlesList.length; i++) {
movieArr[i] = {
title: titlesList[i].innerText.trim(),
// Use nextElementSibling to remove the tag returned by the crawl
// summary: titlesList[i].nextElementSibling.innerText.trim(),
};
}
return movieArr;
})
// Use fs to write the returned untagged content to Json
fs.writeFile(“./netflixscrape.json”, JSON.stringify(movies, null, 3), (err) => {
if (err) {
console.error(err);
return;
};
console.log(“Great Success”);
});
browser.close()
}
scrape(‘https://juejin.cn/post/6844903877909676045’)

Big guy many give directions ~~~ rookie touch fish of time handy wrote a not very mature thing ~ hope to be able to get directions ~~ continue to refuel