javascript - 编剧错误: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 一起安装的。
解决方案
推荐阅读
- unity3d - 动态控制 Unity Cinemachine vCams Blends:如何?
- apostrophe-cms - 是否可以根据其他字段值更改字段行为?
- excel - 将 cell.value 从一个范围传递到另一个子
- opencv - houghlinesp 和阈值处理
- r - 如何编写 n 个步骤,其中每个步骤都是从上一步创建的数据框?
- python - 当您的环境缺少模块时,如何快速运行 GitHub Code?
- vue.js - this.$route 在使用 this.$router.push() 时是否自动添加到参数中
- python - 烧瓶将CSV导入熊猫df
- c# - 如何在我的 Visual Studio 项目中使用包装器?
- ios - 必须为您的 Apple ID 开启双重身份验证