command line - How do I use Headless Chrome in Chrome 60 on Windows 10? -


i've been looking @ following article headless chrome:
https://developers.google.com/web/updates/2017/04/headless-chrome

i upgraded chrome on windows 10 version 60, when run either of following commands command line, nothing seems happen:

chrome --headless --disable-gpu --dump-dom https://www.google.com/ chrome --headless --disable-gpu --print-to-pdf https://www.google.com/ 

and i'm running of these commands following path (the default installation path chrome on windows):

c:\program files (x86)\google\chrome\application\ 

when run commands, seems process second, don't see anything. doing wrong?
thanks.


edit:

as noted mark rajcok, if add --enable-logging --dump-dom command, works. also, --print-to-pdf command works in chrome 61.0.3163.79, you'll have specify different path output file in order have necessary permissions save it.

as such, following 2 commands worked me:

"c:\program files (x86)\google\chrome\application\chrome" --headless --disable-gpu --enable-logging --dump-dom https://www.google.com/ "c:\program files (x86)\google\chrome\application\chrome" --headless --disable-gpu --print-to-pdf=d:\output.pdf https://www.google.com/ 

i guess next step being able step through dumped dom phantomjs dom selectors , whatnot, suppose that's separate question.

you should good. check under chrome version directory

c:\program files (x86)\google\chrome\application\60.0.3112.78 

for command

chrome --headless --disable-gpu --print-to-pdf https://www.google.com/  c:\program files (x86)\google\chrome\application\60.0.3112.78\output.pdf  

edit: still execute commands chrome executable is, in instance

 c:\program files (x86)\google\chrome\application\ 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -