Skip to content

Instantly share code, notes, and snippets.

@noahbroyles
Last active September 24, 2021 15:03
Show Gist options
  • Save noahbroyles/99ddeb164eb316056473c202bec0320f to your computer and use it in GitHub Desktop.
Save noahbroyles/99ddeb164eb316056473c202bec0320f to your computer and use it in GitHub Desktop.
How to get HTML of page rendered with JavaScript

Get full HTML of page rendered in JavaScript

If you want to validate the HTML of a page that is being partially generated in JavaScript, a browser's View Page Source function does not cut it.

To get the page's full HTML content, go into the inspector, right-click on the beginning <html> tag at the top, and select Copy-> Outer HTML.

Then you can paste this into an HTML file and validate or view it. Just remember to put the <!DOCTYPE html> tag at the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment