[lxml-dev] Premature end of data in tag - but it looks well formed

Stefan Behnel stefan_ml at behnel.de
Tue Jul 1 07:24:17 CEST 2008


Hi,

Mike MacCana wrote:
> Hi gents,

Are you sure you don't want advice from any girls?


> I'm a first time user of lxml attempting to etree.parse a document. My
> code (below) works fine on some sample text, but libxml complains about
> the real data with:
> 
> etree.XMLSyntaxError: line 196: Premature end of data in tag html line 5
> 
> The data is below. Line 5 seems OK to me, but I'm new to XML coding so
> maybe I'm missing something.

The problem is not in line 5 (where the html tag starts) but in line 196,
where it apparently ends. Try validating it at the W3C validator if you don't
believe lxml. ;)

Stefan



More information about the lxml-dev mailing list