HTML entities are strings such as "&"
or "<"
. These are encodings of normal ASCII characters that have special uses in HTML. For example, "<"
is the entity for "<"
, but you can't just have "<"
within HTML tags because it is the beginning character for an HTML tag, hence the need to escape it and define the "<"
entity. "&"
is the entity code for "&"
, which as we've just seen is the beginning character for an entity code. If you need to process the text within an HTML document, then you'll want to convert these entities back to their normal characters so you can recognize them and handle them appropriately.
You'll need to install BeautifulSoup
, which you should be able to do with sudo pip install beautifulsoup4
or sudo easy_install beautifulsoup4
. You can read more about BeautifulSoup
at http://www.crummy.com/software/BeautifulSoup/.