This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: htmlparser with tag br
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: ezio.melotti, liuyug
Priority: normal Keywords:

Created on 2012-05-12 08:10 by liuyug, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg160463 - (view) Author: Yugang LIU (liuyug) Date: 2012-05-12 08:10
Hi,

I parse html source with htmlparser. I catch a tag, br, issue. 

my code :
<div>
aaaa<br>
</div>
parse result:
begin tag: div
begin tag: br
end tag: div

So I can't find end tag of 'br'. I know it is invalid text, '<br>', it set htmlparser parameter, strict, to 'False', it can't help me also. 

Please help fix it. Thanks.
msg160481 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-05-12 16:51
The HTML you pasted looks valid to me -- the br element doesn't have an end tag and the HTML 4.01 standard explicitly says "Start tag: required, End tag: forbidden" [0].
Why do you think this is a problem?

[0]: http://www.w3.org/TR/html401/struct/text.html#edef-BR
msg160592 - (view) Author: Yugang LIU (liuyug) Date: 2012-05-14 03:29
By HTML standard, it is not a bug.
I will verify my code. Thanks for your reply.

On 2012-05-13 0:51, Ezio Melotti wrote:
> Ezio Melotti <ezio.melotti@gmail.com> added the comment:
>
> The HTML you pasted looks valid to me -- the br element doesn't have an end tag and the HTML 4.01 standard explicitly says "Start tag: required, End tag: forbidden" [0].
> Why do you think this is a problem?
>
> [0]: http://www.w3.org/TR/html401/struct/text.html#edef-BR
>
> ----------
> assignee:  -> ezio.melotti
> components: +Library (Lib) -None
> nosy: +ezio.melotti
> resolution:  -> invalid
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue14786>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:57:30adminsetgithub: 58991
2012-05-14 04:11:12ezio.melottisetstatus: open -> closed
type: behavior
stage: resolved
2012-05-14 03:29:34liuyugsetmessages: + msg160592
2012-05-12 16:51:14ezio.melottisetnosy: + ezio.melotti
messages: + msg160481

assignee: ezio.melotti
components: + Library (Lib), - None
resolution: not a bug
2012-05-12 08:10:07liuyugcreate