Custom Search

SUBSCRIBE

SUBSCRIBE : 300 + Free Video Tutorials Programming (Python, golang, Julia), DevOps

Friday, January 9, 2015

Convert XML HTML Entities into Unicode String in Python

1)
Goto Python console and Open XML or HTML file
>>> fp = open("myfile.html")

2)
Read it 
>>> content = fp.read()

3)
Convert
>>> u_content = unicode(content, 'utf-8')

4)
Print and copy
>>> u_content





No comments:

Post a Comment