5

I have some documents that are structured using SGML, and I have a DTD file which describes this structure.

Can someone recommend a Python-3 compatible library or module to me to parse this data? For Python 2.x my Google-fu seems to turn up SGMLParser, but that of course is now deprecated (and outright removed from Py3k).

Many seem to suggest lxml, but that is not an option for me due to dependency issues.

I know BeautifulSoup is great for messy markup, but A) last I heard it wasn't py3k compatible, and B) this content is well-structured.

1 Answer 1

3

BeautifulSoup is deprecated. Use the replacement instead, which is Py3k compatible:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.