Is there anyway to get full rendered HTML code of any website (with JavaScript code included)?

Viewed 416

Is there any way we get the full HTML source code of a website with JavaScript code (fetched from 3rd party) are also included in it?

I understand we can get using document.getElementsByTagName('html')[0].innerHTML but it will not include the 3rd party JS in the HTML code?

enter image description here

The reason for this question (based on my knowledge) is when the browser renders and create DOM then it should have all the required files so does anyone know where and how we can get that full HTML source code of any website?

1 Answers

Yes when the browser renders the page it does indeed fetch these resources, you can use the save option provided by the browser, by clicking right click, then save as, then save as a complete webpage.

If the previous does not work, then there are many tools, extensions, applications that provides this functionality and its easy to search for them.

If you want to save the html and its resources in one html file, you can save it as mhtml file, using this extension for example https://chrome.google.com/webstore/detail/save-webpages-offline-as/nfbcfginnecenjncdjhaminfcienmehn.

Related