Answers for "reading doc in python"

0

reading doc in python

from bs4 import BeautifulSoup as bs
soup = bs(open(filename).read())
[s.extract() for s in soup(['style', 'script'])]
tmpText = soup.get_text()
text = "".join("".join(tmpText.split('\t')).split('\n')).encode('utf-8').strip()
print text
Posted by: Guest on June-11-2021

Browse Popular Code Answers by Language