playwright错误:UnhandledPromiseRejectionWarning:超时错误:等待firstPage代理失败:超时超过30000ms

时间:2020-01-28 05:10:09

标签: javascript playwright

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` });

  }
})();

我尝试运行此代码段。如预期的那样,需要截取铬和Firefox的屏幕截图。但是尝试从Webkit截屏时会引发超时错误。但是,local-webkit随playwright一起安装。

0 个答案:

没有答案