As a work-around, if there's only a handful of wrong records, catching the 
error and fixing the records in the DB does the job:

=======
try:
    #file.write(soup.body.text)
    text = soup.body.text
except AttributeError as error:
    file.write(str(error))
========
_______________________________________________
lxml - The Python XML Toolkit mailing list -- lxml@python.org
To unsubscribe send an email to lxml-le...@python.org
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: arch...@mail-archive.com

Reply via email to