Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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('	')).split('
')).encode('utf-8').strip()
print text
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #reading #doc #python
ADD COMMENT
Topic
Name
1+9 =