Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • 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"))
@ukw16
Copy link

ukw16 commented Feb 18, 2025

thank you. saved my life

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment