I'm regularly doing web scraping using Python, and I tend do download the source of a URL (e.g. using cURL
) and then examine the contents of the downloaded file.
I use TextMate for all editing, but going through unformatted HTML is rather masochistic. What would be ideal is a viewer that parses the DOM and presents it in a structured way, and optionally reformats the HTML code.
Below is a screenshot showing Xmplify, a native macOS XML editor that does exactly that, but for XML files. If something like this existed for HTML files, it'd be perfect.
Another example, this time for JSON, is Jayson.
Remarks:
Why not use Xmplify for HTML source? Because not all HTML is well-formed and I don't want to make changes to the original code (that would "interfere" with scraping).
I know that most browsers offer developer tools and have some/all of this functionality. However, as I'm doing scraping with
requests
, I need to use the HTML code without any JavaScript being run (and possibly modifying the DOM). And yes, I could turn off JavaScript in the browser, but I'd prefer not to.I don't need anything like validation, previewing, WYSIWYG, … My use case is web scraping, not web design.
So to reiterate, the requirements are:
- DOM outline
- HTML reformatting
Preferences:
- I would definitely prefer a native Mac app (no Java, Electron, …).
- If it only does what I need, even better (e.g. I'd prefer if it doesn't do n number of other things as well).
Thank you!