I would like to save the web page (all content) as a text file. (As if you made a right click on a web page -> "Save Page As" -> "Save As Text File", and not as an html file)
I tried using the following code:
import urllib2
url=''
page = urllib2.urlopen(url)
page_content = page.read()
file = open('file_text.txt', 'w')
f.write(page_content)
f.close()
My goal is to save all text without html code. (for example, I would like to read "รจ" "& eacute" instead)
source
share