【问题标题】:How to set timeout for headless chrome如何为无头镀铬设置超时
【发布时间】:2018-04-23 12:48:28
【问题描述】:

我试试:

chrome --timeout 15000 .....

如果 chrome 没有在 15 秒内完成,它应该立即完成。

但是当我跑步时

chrome --headless --disable-gpu --timeout 30000 --dump-dom http://example.com

我明白了

[1110/120048.838007:ERROR:headless_shell.cc(603)] 打开多个标签 仅在启用远程调试时才支持。

它可以在没有 --timeout 标志的情况下工作

Chrome Canary v64 操作系统

2019 年 11 月更新

我注意到这个问题得到了一致的意见,但仍然 没有或几乎没有价值。我想更新我现在使用的 puppeteer,这是谷歌自己的项目,使用无头 Chrome 使用 NodeJs,它是非常简单直接的 API。如果你是 可以使用 NodeJs - 检查它。

https://github.com/GoogleChrome/puppeteer

【问题讨论】:

  • 你用的是什么库?
  • @griffith_joel Ubuntu 或 OS X + Chrome。没有图书馆。只是无头 chrome CLI

标签: node.js macos google-chrome-headless


【解决方案1】:

仅在 macOS 上使用 =

chrome --timeout=30000 --headless --disable-gpu --dump-dom http://example.com

【讨论】:

    【解决方案2】:

    您需要将--timeout 标志放在--headless 标志之前

    chrome --timeout 30000 --headless --disable-gpu --dump-dom http://example.com
    

    【讨论】:

      【解决方案3】:

      尝试使用chrome --headless --disable-gpu —-timeout=30000 --dump-dom http://example.com

      【讨论】:

        猜你喜欢
        • 2017-12-23
        • 2019-12-12
        • 2018-10-11
        • 2018-05-03
        • 1970-01-01
        • 2015-02-14
        • 2018-01-02
        • 2018-08-24
        • 1970-01-01
        相关资源
        最近更新 更多