This question is about executing javascript AND HTML in the command line.

\*\*\*\* very important : this is **NOT** about scrapping. It's about "rendering" or executing the javascript contained in a private .html (not web accessible) and save the result in a new .html with the javascript executed result

CONTEXT : I have private .html (those .html have css, javascript, etc) but "unrendered"... if I see what I mean.

WHAT I WANT TO ACCOMPLISH : in a automated php script => I create a raw (unexecuted) .html => cli with the .html => execute javascript => save the result in a new .html

I TRIED : google-chrome headless -> it can save as PNG or PDF, but unable to save it as .html :(

OTHER ISSUE with google-chrome headless : the option `--dump-dom` saves the original .html not the executed one...

example

```
google-chrome 
--headless --hide-scrollbars --run-all-compositor-stages-before-draw 
--virtual-time-budget=10000 --disable-translate --disable-popup-blocking 
--disable-infobars --ignore-certificate-errors --autoplay-policy=no-user-gesture-required 
--disable-gpu --dump-dom 
"someHTML_with_CSS_AND_JAVASCRIPT.html" > final.html

```

Other command line solutions like CutyCapt, wkhtmltopdf, etc have the same problem : only save in pdf or jpg or png, I want to save in .html