Abstract
Python has always been shipped with a cgi module to escape different characters, but this has limitations. Starting with Python 3.2, the HTML module curbs these shortcomings. HTML parsing and entities are achieved using different modules in Python 2 and 3, which makes a unified code base even harder to write. This chapter describes ways of implementing HTML escaping, parsing, and entities that work in both Python 2 and Python 3.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Joannah Nanjekye
About this chapter
Cite this chapter
Nanjekye, J. (2017). HTML Processing. In: Python 2 and 3 Compatibility. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2955-2_7
Download citation
DOI: https://doi.org/10.1007/978-1-4842-2955-2_7
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-2954-5
Online ISBN: 978-1-4842-2955-2
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)