Skip to content

Instantly share code, notes, and snippets.

@jobelenus
Created January 31, 2018 16:54
Show Gist options
  • Save jobelenus/72596748e456ab999415e71ada6e9abb to your computer and use it in GitHub Desktop.
Save jobelenus/72596748e456ab999415e71ada6e9abb to your computer and use it in GitHub Desktop.
xml = """<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
<?adf version="1.0"?>
<adf>
<prospect status="new">
...
</prospect>
</adf>
"""
from bs4 import BeautifulSoup
doc = BeautifulSoup(xml, "xml")
# doc.adf.prospect is null
xml = """
<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
<?adf version="1.0"?>
<adf>
<prospect status="new">
...
</prospect>
</adf>
"""
from bs4 import BeautifulSoup
doc = BeautifulSoup(xml, "xml")
# doc.adf.prospect is not null!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment