官方英文版API入口:https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md.
汉化版API入口:https://yq.aliyun.com/articles/607102.
学习笔记入口:https://blog.youkuaiyun.com/qupan1993/article/details/85371556.
我们可以使用page.evaluaate()函数来执行自定义的一些js脚本,在写爬虫的时候我们需要得到一些网址、文本、图片、视频等信息,我们需要去解析网页Dom得到信息并返回,这些都在函数中进行,先看一下官方给的解释和小demo
1、好啦上个例子看看喽、抓取百度首页右上角的标题和对应的URL网址。这个大概就是很简单的爬虫入门了吧
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
headless:false});
const page = await browser.newPage();
await page.goto('https://www.baidu.com/',{
waitUntil</