by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

Here I provide the execution method on Mac
Snapshot: output.png will be produced
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless\
--screenshot https://www.google.com
Print PDF: output.pdf will be output
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless\
--print-to-pdf https://www.google.com
Available parameters are listed below:
Description Useful parameters
Screenshots --screenshot
Create PDFs --print-to-pdf
Dump the DOM --dump-dom
Window size --window-size=412,732

Tags:

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


vim

Write Code with Command Line's Vim??

If you are a beginner of Vim, do you want to use Command Line Vim to connect to the remote host to write Code? Ok you've come to the right place, please at least consider reading this article. Here is a short video on how to manage cheats...

seo

How do I optimize my website's image files with docker

​​​​​​​​​​This article introduces how I use docker to optimize my own image files. Directly shrink the image files in the directory, and optimize the graphics with one line of command.

php

How to install PHP 7.1.7 in the old version of CentOS 5.11?

How to install PHP 7.1.7 on the old version of CentOS 5.11? An insfinit error occurred when compiling by myself. This article introduces my method.