Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iamsingularity/cae5da99efa566e69e18947c99a87ecd to your computer and use it in GitHub Desktop.
Save iamsingularity/cae5da99efa566e69e18947c99a87ecd to your computer and use it in GitHub Desktop.
Parse a local HTML file with Python 3 and Beautiful Soup 4
from bs4 import BeautifulSoup
soup = BeautifulSoup(open("C:\\path\\to\\your\\html\\file.html", encoding="utf8"), "html.parser")
print(soup.find_all("div", class_="someclass"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment