puppeteer报错 UnhandledPromiseRejectionWarning: Error: Protocol error (Page.getLayoutMetrics): Target closed.

puppeteer runtime error:

UnhandledPromiseRejectionWarning: Error: Protocol error (Page.getLayoutMetrics): Target closed.

solve:

in

await browser.close();

Before adding the waiting time

await page.waitFor(1000);

 

ps: Although the problem has been solved, but still do not quite understand why. Since the other file before closing the browser did not increase the waiting time does not complain.

Guess you like

Origin www.cnblogs.com/muou2125/p/11352746.html