Skip to content

Instantly share code, notes, and snippets.

@sitano
Created March 31, 2015 14:50
Show Gist options
  • Save sitano/16f108e5262c03325e7e to your computer and use it in GitHub Desktop.
Save sitano/16f108e5262c03325e7e to your computer and use it in GitHub Desktop.
HTML Python Prettifier with Beautiful Soup
# The current release is Beautiful Soup 4.3.2 (October 2, 2013).
# You can install it with pip install beautifulsoup4 or easy_install beautifulsoup4.
# It's also available as the python-beautifulsoup4 package in recent versions of Debian, Ubuntu, and Fedora .
from bs4 import BeautifulSoup as bs
import fileinput
import sys
for line in fileinput.input(sys.argv[1]):
print bs(line).prettify()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment