user1427661
user1427661

Reputation: 11774

Tool for Viewing Formatted HTML Source Code in Browser

I'm developing a web scraping tool in Python, and I need to get intimately acquainted with the functions of various HTML tags on certain sites. Unfortunately, the "view source" that Chrome, Firefox, and Safari offer does not output very well formatted HTML source code -- it tends to place a huge number of tags on the same line. Do the browsers offer any plugins that may be able to clean things up a bit, or do I need to get/develop some kind of tool in Python that takes dirty HTML as input and outputs cleanly formatted HTML?

Upvotes: 4

Views: 11520

Answers (2)

user263693
user263693

Reputation: 111

With Firefox you can select (highlight - I am writing for beginners also) the text, and once it is selected, release the left mouse button and right click within the selected area and choose "View selection source." You can then copy the highlighted text and paste it.

My composite example: View selection source

Upvotes: 0

Olivier Coq
Olivier Coq

Reputation: 41

Since I work primarily with Chrome, the best examples I can think of are Code Formatter (Chrome)

This isn't automatic; you have to copy and paste the entire page into the app. Also the app window is small (this unalterable to my knowledge), but relatively effective.

...and JavaScript and CSS Beautifier

Much more effective and clean, but only works, as the title suggests, with .Js and CSS.

Upvotes: 2

Related Questions