Skip to content

Instantly share code, notes, and snippets.

View alexmill's full-sized avatar
🌴

Alex Miller alexmill

🌴
View GitHub Profile
@alexmill
alexmill / soup_viz.py
Last active October 2, 2019 01:33 — forked from dmattera/soup_prettify2.py
Visualize HTML structure of a BeautifulSoup object
# Visualize HTML structure of a BeautifulSoup object with:
# - vertical connecting lines
# - option to remove attributes
# Forked from Dan Mattera's : https://gist.github.com/danmattera/ef11cb37c31d732f9e5d2347eea876c2
# By Alex Miller https://alex.miller.im
from bs4 import BeautifulSoup as BS
def BeautifulSoup(X):
# This just sets the default parser for BeautifulSoup
# to "html.parser" so it doesn't alwasy add <html><body>