I think I screwed up. I believe I've come down with a small case of "operator error."

-- Craig

Brian Raven wrote:

-----Original Message-----
From: Craig Cardimon [mailto:[EMAIL PROTECTED] On Behalf Of Craig Cardimon
Sent: 06 September 2005 14:40
To: ActivePerl
Subject: HTML::TokeParser and tags split between lines

I'm using HTML::TokeParser to remove HTML. This functions very well when tags are contained on one line.

What happens when you're reading a file line by line, and the HTML tag is split between lines? The HTML I'm dealing with is sometimes broken up. For instance, I'll get lines beginning with "size=2>" which is the end of a tag that began on the previous line.

Any suggestions or recommendation on cleaning up -- as in removing -- this kind of "broken" HTML?


Unless the html is broken in some way, other than simply being wrapped
in the middle of a tag, I would be surprised if that would cause
HTML::Parser any problems. However, it sounds, from your description,
like you are giving the html to HTML::TokeParser line at a time. I hope
I misunderstand, as it seems like an odd thing to do, but it would
certainly explain why you are having problems. You need to give
HTML::TokeParser the whole document to parse, as described in the
documentation for 'new'.

HTH



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0536-1, 09/06/2005
Tested on: 9/6/2005 1:04:17 PM
avast! - copyright (c) 1988-2004 ALWIL Software.
http://www.avast.com



_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to