[Tutor] finding mismatched or unpaired html tags

spir denis.spir at free.fr
Tue Apr 28 17:12:51 CEST 2009


Le Tue, 28 Apr 2009 07:41:36 -0700,
"Dinesh B Vadhia" <dineshbvadhia at hotmail.com> s'exprima ainsi:

> This is the error and traceback:
> 
> Unexpected error opening J:/F2/....html: mismatched tag: line 124, column 8
> 
> Traceback (most recent call last):
>   File "C:\....py", line 492, in <module>
>     raw = extractText(xhtmlfile)
>   File "C:\....py", line 334, in extractText
>     tree = make_tree(xhtmlfile)
>   File "....py", line 169, in make_tree
>     return tree
> UnboundLocalError: local variable 'tree' referenced before assignment
>  
> 
> Here is line 124, col 8 and I cannot see any obvious missing/mismatched
> tags:
> 
> "<p>As to the present time I am unable physical and mentally to secure all
> this information at present.</p>"
> 
> Dinesh

As for programming syntax error, the place where an html error is detected by the parser may well be one or more line(s) after the actual error: you should watch lines before #124.
Also, the traceback looks strange: it seems that ElementTree interprets a python UnboundLocalError for the variable 'tree' as being caused by an html error in source. ???

denis
------
la vita e estrany


More information about the Tutor mailing list