Skip to content

Instantly share code, notes, and snippets.

@chewbranca
Created June 9, 2012 06:16
Show Gist options
  • Save chewbranca/2899776 to your computer and use it in GitHub Desktop.
Save chewbranca/2899776 to your computer and use it in GitHub Desktop.
str = '<?xml version="1.0"?><feed xmlns:media="http://search.yahoo.com/mrss/" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:idx="urn:atom-extension:indexing" xmlns="http://www.w3.org/2005/Atom" idx:index="no" gr:dir="ltr"><gr:continuation>CMKC26-OorAC</gr:continuation></feed>'
str = '<?xml version="1.0"?><feed xmlns:media="http://search.yahoo.com/mrss/" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:idx="urn:atom-extension:indexing" xmlns="http://www.w3.org/2005/Atom" idx:index="no" gr:dir="ltr"><gr:continuation>CMKC26-OorAC</gr:continuation></feed>'
>>> x = BeautifulSoup(str, 'xml')
x = BeautifulSoup(str, 'xml')
>>> x
x
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:idx="urn:atom-extension:indexing" xmlns:media="http://search.yahoo.com/mrss/" {http://www.google.com/schemas/reader/atom/}dir="ltr" {urn:atom-extension:indexing}index="no"><gr:continuation>CMKC26-OorAC</continuation></feed>
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment