Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ScribbleGhost/e5b6a808681004d207a3ee7fdb6ec9ea to your computer and use it in GitHub Desktop.
Save ScribbleGhost/e5b6a808681004d207a3ee7fdb6ec9ea 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