I have a webpage that's open in a chrome browser but the page no longer exists. What javascript should I type in the console to get a copy of the entire page html?
I have a webpage that's open in a chrome browser but the page no longer exists. What javascript should I type in the console to get a copy of the entire page html?
If you have a webpage open in Chrome but the page no longer exists (e.g., it has been removed or the server is down), you can still retrieve the HTML of the page as it was when it was last loaded. Here's how you can do it using JavaScript in the Chrome Developer Console: 1. Open the Chrome Developer Console: - Right-click anywhere on the page and select **Inspect**. - Go to the **Console** tab. 2. Run the following JavaScript code to get the entire HTML of the page:
1 2 | console.log(document.documentElement.outerHTML); |
Testing if the previous output contains the string outerHTML
: True