我提交一个表单使用以下代码,我希望木偶等待表单提交后的页面加载。
await page.click("button[type=submit]");
//how to wait until the new page loads before taking screenshot?
// i don't want this:
// await page.waitFor(1*1000); //← unwanted workaround
await page.screenshot({path: 'example.png'});
如何与木偶等待页面加载?