from bs4 import BeautifulSoup import html5lib myFile=open('C:/Users/CSE/AppData/Local/atom/app-1.42.0/practise.html','r') soup=BeautifulSoup(myFile,"html5lib") print(soup.prettify())