Thanks for the reply.
See, it sure ought to be valid HTML - it's from a major website,
pulled via a widely used package.
I've found that stripping scripts:
stripped = re.sub(r'<script.+/>', '', text)
helps some.
I'm not completely sure why, because the soup still ends with all the
</divs>.
If you're curious, I can send email you the source text, I'd be much
obliged, because my solution feels fragile.
On Feb 2, 4:37 pm, Jim Tittsler <
jtitts...@gmail.com> wrote: