# Extracting raw html from locally saved html file using BeautifulSoup from bs4 import BeautifulSoup url = r"C:example.html" soup = BeautifulSoup(url, "html.parser") text = soup.get_text() print (text)