javascript - 启用远程调试时禁用导航超时
问题描述
我看到了关于 --remote-debugging 的其他部分,但是在运行我的谷歌云功能时,我没有启用它。我仍然收到回调:
未处理的错误错误:无法启动浏览器进程![0122/235916.996111:ERROR:headless_shell.cc(204)] 启用远程调试时禁用导航超时。
我对 puppeteer 的初始化是:
const browser = await puppeteer.launch(PUPPETEER_OPTIONS);
const page = await browser.newPage();
我的 PUPPETEER_OPTIONS 等于:
const PUPPETEER_OPTIONS = {
headless: true,
args: [
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-setuid-sandbox',
'--timeout=30000',
'--no-first-run',
'--no-sandbox',
'--no-zygote',
'--single-process',
"--proxy-server='direct://'",
'--proxy-bypass-list=*',
'--deterministic-fetch',
],
};
我正在运行 node10 并使用 puppeteer v5.5.0,并在谷歌云功能中运行 puppeteer。我试过取出'-timeout = 30000',只留下'--no-sandbox',有无无头:真的,错误仍然存在。
解决方案
我将以下 puppeteer 配置与 NodeJS 10 框架一起使用,它对我有用
const PUPPETEER_OPTIONS = {
headless: true,
args: [
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-setuid-sandbox',
'--no-sandbox',
'--window-size=1920,1080'
]
};
推荐阅读
- vmware - 使用 Powercli 在值列中拆分字符串
- python - 使用 Django ORM 查找父数据
- r - 在 Shiny 中获取格式错误的输出
- spring - 如何在 Keycloak Spring Java 集成中更改重定向 url
- angular - 使用 Angular 4/5/6 将不同的对象数组导出到 Excel
- javascript - 在时刻js从数组中删除重复项
- python - 如何在 wagtail 中使用 RichTextEditor (drafttail) 以用不同的样式标记文本的不同部分?
- javascript - jQuery 脚本在 IE 中无法正常工作
- c# - 使用 Bot Framework 4 的一对一主动消息传递
- c++ - 如何修复 DirectX9 中的纹理