Windows 10:Chrome headless 什么都不做

ic3*_*ic3 5 google-chrome-devtools

在 Windows 10 中输入以下命令并启动无头 chrome 版本时,没有任何反应(有/没有扩展):

"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 
      --disable-extensions --headless --disable-gpu --print-to-pdf
Run Code Online (Sandbox Code Playgroud)

它只是默默地返回到命令行,我找不到任何 pdf 文件。

有没有人有同样的问题并设法解决它?

我正在使用:Google Chrome 63.0.3239.84(官方版本)(64 位)(队列:63_win_84)

Dim*_*ilo 7

看起来 Chrome 无权在目录中写入。
尝试使用 --enable-logging 标志启动命令。比如:
"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --enable-logging --disable-extensions --headless --disable-gpu --print-to-pdf
你会收到一个错误。修复它,它将开始工作。您可以在此处找到更多信息:
如何在 Windows 10 上的 Chrome 60 中使用 Headless Chrome?

  • 添加位置后它就可以工作了,太棒了。--print-to-pdf=c:\temp\output.pdf。谢谢 (3认同)

小智 0

我遇到了这个问题。

我的解决方案是下载 Canary Build for Chrome。 https://www.google.com/chrome/browser/canary.html

然后,它将安装到 C:\User\userName\AppData\Local\Google\Chrome SxS\Application。尝试运行指向此安装的命令。