ic3
ic3

Reputation: 7680

Windows 10 : Chrome headless not doing anything

When entering the following command in Windows 10 and start a headless chrome version, nothing is happening (with/without extensions):

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

It just returns to the command line silently and I can't find any pdf file.

Does anybody had the same issue and manage to solve it ?

I'm using : Google Chrome 63.0.3239.84 (Official Build) (64-bit) (cohort: 63_win_84)

Upvotes: 6

Views: 6874

Answers (3)

rofrol
rofrol

Reputation: 15216

chrome needs full path also.

To use it in cmd.exe:

start chrome --enable-logging --headless --disable-gpu --print-to-pdf=%cd%\output.pdf https://www.google.com/

Upvotes: 1

Dima Kurilo
Dima Kurilo

Reputation: 2276

It looks like Chrome doesn't have rights to write in the directory.
Try to launch command with --enable-logging flag. Like:
"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --enable-logging --disable-extensions --headless --disable-gpu --print-to-pdf
You will receive an error. Fix it and it will start to work. You can find more information here:
How do I use Headless Chrome in Chrome 60 on Windows 10?

Upvotes: 9

kevin micol
kevin micol

Reputation: 61

I was experiencing this problem.

My solution was to go and download the Canary Build for Chrome. https://www.google.com/chrome/browser/canary.html

This will then get installed to C:\User\userName\AppData\Local\Google\Chrome SxS\Application. Try running your commands pointing to this install.

Upvotes: 0

Related Questions