I am trying to clear an xml file using BeautifulSoup 4.4.0 with tag names in camelCase, and find_all cannot seem to find them. Code example:
from bs4 import BeautifulSoup xml = """ <hello> world </hello> """ soup = BeautifulSoup(xml, "lxml") for x in soup.find_all("hello"): print x xml2 = """ <helloWorld> :-) </helloWorld> """ soup = BeautifulSoup(xml2, "lxml") for x in soup.find_all("helloWorld"): print x
The output I get is:
$ python soup_test.py <hello> world </hello>
What is the correct way to search for camel / uppercase tag names?
python beautifulsoup
Paul johnson
source share