Get final generated HTML on Chrome

Asked by At

I'm programming an dynamic website that simulates pokemon-style fights with Digimon. I need to get the current, postprocessed, postcss,postjs etc HTML file in order to test new features.

The following is the website visual while running the html file (one browser runs js and css). enter image description here

The following is what I get when just copying the HTML from the browsers inspect element. enter image description here

Is there a way to easily get the post generated HTML? I know inspect-element HTML doesn't storage js/css changes, but the browser has to somehow generate the webpage , the final HTML must be somewhere

2 Answers

toto1911 On Best Solutions

Answer to close the topic :

Try right click -> Save As. It should generate a folder with an HTML file and all the scripts you need

As mention by @Doğancan Arabacı :

it's not guaranteed to get everything exactly as you see in a different page. There might be ajax requests, which will be responded only to specific domain. In that case your page would look different. There might be certain cookies, session parameters etc. So, you can probably copy 99% of the page but never guarantee that it'll be 100% same

Doğancan Arabacı On

What you want to do is impossible. What you see in your browser is not post generated HTML. Well, it's not the only thing there. There is CSS rules applied, there is javascript changes. Even your javascript might add CSS or more scripts etc. To get the state you want, your page/html files should do exact same things.