Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

copy and paste code from safari (chrome) web inspector

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?

like image 502
bandola Avatar asked Apr 17 '12 21:04

bandola


2 Answers

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.

like image 154
renozu Avatar answered Feb 12 '23 09:02

renozu


On the console, try document.documentElement.outerHTML.

like image 29
mia Avatar answered Feb 12 '23 08:02

mia