11

I need to view all source HTML in plain text in one place. I need it from an already loaded page. CTRL+U (View Source) refreshes the page. The page I'm trying to view can only be accessed via proper form submit. What I really want is for CTRL+U to not refresh the page.

I need the HTML source of an already loaded page added to my clipboard.

BSMP
  • 4,596
  • 8
  • 33
  • 44
Dor1000
  • 331
  • 2
  • 13

3 Answers3

18

I think none of the other answers really answer your question.

You want the exact response from the server, not the current DOM, and you want it with the exact request headers that was sent the first time.

To do so, open the Chrome Dev Tools and select the "Network" tab.

Network tab in Google Dev Tools

The very first request should be the page you requested. Click it and select the tab "Response" on the right side to get the exact response the server gave you.

Response tab in Network tab

Tim
  • 5,893
  • 3
  • 35
  • 64
  • 1
    Sadly this requires the dev tools to be already open. Not an option if some other program is displaying a temporary file in a new tab. – Timmmm Feb 05 '18 at 19:41
  • 3
    @Timmmm check out this answer on how to start chrome with the dev tools always open. https://stackoverflow.com/questions/12212504/automatically-open-chrome-developer-tools-when-new-tab-new-window-is-opened/36957422#36957422 – Tim Feb 09 '18 at 06:29
1

Right click-> inspect element anywhere you want to see the html, it still show the code of all the page ans you can modify the value of html/css directly in it.

Matriac
  • 382
  • 3
  • 11
  • thank you, but i dont see plain html. i see "elements" tab which is all nested. it handles page search but i cant hilight/copy and i cant select all. how can i get plain text html from this. – Dor1000 Dec 15 '15 at 05:59
  • 1
    ok i found it. dev tools, elements tab, right click html tag, copy, copy outer html. – Dor1000 Dec 15 '15 at 06:02
  • it doesnt include doc type and if there's soemthing outside html, by mistake, then i probably wont get it. kind of a hack fix but it solves my problem : ) – Dor1000 Dec 15 '15 at 06:07
  • this is the runtime html though. so the actual html of the entire body might just be `
    ` but doing it this way shows you the dom as the browser is rendering it. this is not the same as "view source"
    – frumbert Apr 23 '18 at 00:26
-1

The only answer is the one Dor1000 provided himself in a comment:

dev tools, elements tab, right click html tag, copy, copy outer html.

He wants the current HTML (after javascript or any other modifications, not the original source HTML).

JohnP2
  • 1,899
  • 19
  • 17