首页 > 解决方案 > 编剧错误:UnhandledPromiseRejectionWarning:TimeoutError:等待firstPage代理失败:超时30000ms

问题描述

const playwright = require("playwright");

(async () => {
  for (const browserType of ["chromium", "firefox", "webkit"]) {
    const browser = await playwright[browserType].launch();
    const context = await browser.newContext();
    const page = await context.newPage('https://google.com/');
     await page.screenshot({ path: `example-${browserType}.png` });

  }
})();

我试图运行这个片段。它按预期从 Chromium 和 Firefox 中截取屏幕截图。但是当它尝试从 webkit 截取屏幕截图时会引发超时错误。虽然,local-webkit 是与 playwright 一起安装的。

标签: javascriptplaywright

解决方案


推荐阅读