const target = browser.waitForTarget 获取跳转页面
const newPage = await target.page() 获取跳转页面的控制权
const puppeteer = require("puppeteer");
const url = "http://www.kuwo.cn/";
(async () => {
const browser = await puppeteer.launch({
headless:false,
defaultViewport: null, //可视区域最大化
});
const page = await browser.newPage();
await page.goto(url)
var a2 = await page.$(".sub_nav a:nth-child(2)");
await a2.click()
const target = await browser.waitForTarget(t=>t.url().includes("rankList"));
const newPage = await target.page();
var res = await newPage.$eval(".btns .play span",ele=>ele.innerHTML);
console.log(res)
})();