7

I want to copy some html code from the web inspector but am only able to copy one line at a time. Is there any way to select a block of elements or all elements?

jlaceda
  • 866
  • 6
  • 11
bandola
  • 267
  • 1
  • 3
  • 13
  • Does it work in any non-WebKit browsers you may have installed? Opera, Firefox, or Konqueror? What about RockMelt (a modded version of Chrome)? – Jules Jul 16 '12 at 02:32

3 Answers3

5

If you right click on any element in the Web Inspector, then click "Copy as HTML" on the resulting pop-up menu, you can then paste the html for that element (and all enclosed elements) into your editor. You can get the entire document by doing this with the <html> element.

renozu
  • 326
  • 4
  • 5
  • 1
    This does not appear to capture the inner content of IFRAME elements, despite the fact they show in the inspector hierarchy. – goodside Oct 05 '12 at 20:19
  • If you want to capture the inner content of an `iframe`, you'll have to select the first `html` tag within the `iframe` and proceed as @renozu suggested. – Wallace Sidhrée Apr 03 '14 at 08:45
2

On the console, try document.documentElement.outerHTML.

Eva Dias
  • 1,709
  • 9
  • 36
  • 67
mia
  • 21
  • 2
0

You could view the html response from the Network section of Chrome

jlaceda
  • 866
  • 6
  • 11