Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In headless chrome, how do i change the default output filename?

I am using this command to generate the screenshot chrome --headless --disable-gpu --screenshot --window-size=1280,1696

It's generating the output in current directory with name screenshot.jpeg. I want to change the default output directory as well as output filename. Can somebody tell me the correct options I need to use?

like image 397
Yogesh Bhosale Avatar asked Sep 04 '25 16:09

Yogesh Bhosale


1 Answers

you can specify your filename in --screenshot option.

eg.,

chrome --headless --disable-gpu --screenshot=newfilename.png https://www.chromestatus.com/
like image 190
Murugan Krishamoorthy Avatar answered Sep 07 '25 18:09

Murugan Krishamoorthy