Jul-04-2023, 05:03 AM
Now changed to
from bs4 import BeautifulSoup with open('testxml.xml', 'r') as f: file = f.read() # 'xml' is the parser used. For html files, which BeautifulSoup is typically used for, it would be 'html.parser'. soup = BeautifulSoup(file, 'xml') print(soup.get_text()) # produces blank o/p for payee in soup.find_all('PAYEE'): print(payee.get('Cash')) # all lines have 'None'Either no o/p or the words 'None'. There is at least one dataset that should match
Quote: <PAYEE matchingenabled="0" email="" name="Cash" reference="" id="P000031">
<ADDRESS street="" telephone="" state="" city="" postcode=""/>
</PAYEE>