Issue 23438: HTMLParser doesn't know how to deal with 'ampersand' (original) (raw)

Issue23438

Created on 2015-02-10 22:01 by pyed, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
htmlparser_bugs.py pyed,2015-02-10 22:01 demonstrating HTMLParser behaviour with '&'
Messages (2)
msg235714 - (view) Author: pyed (pyed) Date: 2015-02-10 22:01
the attached file use example from : https://docs.python.org/3/library/html.parser.html and it will show different cases where HTMLParser fail to parse '&' and '&'
msg235715 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2015-02-10 22:31
& is an entity reference. Either pass "convert_charrefs=True" to the constructor, or implement a method "def handle_entityref(self, data)" to receive them as events. https://docs.python.org/3.4/library/html.parser.html
History
Date User Action Args
2022-04-11 14:58:12 admin set github: 67626
2015-02-10 22:31:10 amaury.forgeotdarc set status: open -> closednosy: + amaury.forgeotdarcmessages: + resolution: not a bug
2015-02-10 22:02:38 pyed set title: HTMLParser don't know how to deal with 'ampersand' -> HTMLParser doesn't know how to deal with 'ampersand'
2015-02-10 22:01:22 pyed create