await page.goto('woleigequ.net'); // 打开woleigequ.net await page.waitForSelector('#goto'); // 等待并获取点击跳转的goto元素const link = await page.$('#goto');const newPagePromise = new Promise(x => browser.once('targetcreated', target => x(target.page()))); // 声明变量await link.click(); // 点击跳转const newPage = await newPagePromise; // newPage就是a链接打开窗口的Page对象
await page.goto('woleigequ.net'); // 打开woleigequ.net
await page.waitForSelector('#goto'); // 等待并获取点击跳转的goto元素
const link = await page.$('#goto');
const newPagePromise = new Promise(x => browser.once('targetcreated', target => x(target.page()))); // 声明变量
await link.click(); // 点击跳转
const newPage = await newPagePromise; // newPage就是a链接打开窗口的Page对象