google-chrome - headless Chrome REPL 不起作用

标签 google-chrome google-chrome-headless

当我尝试运行时:

google-chrome --headless --disable-gpu --repl http://google.com

变得无限:

[0829/155519.758686:INFO:headless_shell.cc(303)] Type a Javascript expression to evaluate or "quit" to exit.
>>> {"result":{"type":"undefined"}}
>>> {"result":{"type":"undefined"}}
>>> {"result":{"type":"undefined"}}
>>> {"result":{"type":"undefined"}}
...

Ubuntu 16.04 上的 Google Chrome 60.0.3112.113

这是 Chrome 中的错误吗?

最佳答案

直接使用二进制文件/opt/google/chrome/chrome 而不是 google-chrome,它指向 bash 脚本/usr/bin/google-chrome。

摘自评论

https://developers.google.com/web/updates/2017/04/headless-chrome#screenshots

关于google-chrome - headless Chrome REPL 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45939872/

相关文章:

xml - 为什么我会收到关于 XML 声明的错误?

flash - Google Chrome、Flash 和 z-index 错误行为

google-chrome - TestCafe 中的浏览器功能

css - 过滤器灰度不适用于 Chrome

Headless Chrome - 共享凭证

python - 使用 Headless Chrome Webdriver 运行 Selenium

javascript - 使用 Puppeteer 时等待文本出现

javascript - 这是 Chrome 的错误吗?我该如何解决? : It skips some alert comments in the opener's Function

java - 在 Selenium 中运行 headless Chrome 会抛出 "unknown error: DevToolsActivePort file doesn' t 存在”

google-chrome-headless - 如何在 headless chrome 实例上设置缩放级别?