Re: BeautifulSoup.BeautifulSoup(xmlstring) tags into lower case

112 views
Skip to first unread message

Aaron DeVore

unread,
Aug 10, 2012, 6:52:53 PM8/10/12
to beauti...@googlegroups.com
That is a problem with the underlying library, sgmllib. It
automatically lower cases all tags, even with xml. Instead, switch to
Beautiful Soup 4 with lxml as the parser. That will look like:

import bs4
soup = bs4.BeautifulSoup(markup, "xml")

-Aaron DeVore

On Fri, Aug 10, 2012 at 3:00 AM, revelc33 <martinm...@gmail.com> wrote:
> Hi everybody!
> I have a problem with BeautifulSoup.BeautifulSoup(xmlstring) changes the
> tags of the xml string into lower case. I need to avoid this!!! Any idea ?
>
> Thanks & Best Regards
>
> Revelc
Reply all
Reply to author
Forward
0 new messages