Turning HTMLParser into an iterator

S

samwyse

I'm processing some potentially large datasets stored as HTML. I've
subclassed HTMLParser so that handle_endtag() accumulates data into a
list, which I can then fetch when everything's done. I'd prefer,
however, to have handle_endtag() somehow yield values while the input
data is still streaming in. I'm sure someone's done something like
this before, but I can't figure it out. Can anyone help? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top