21 lines
523 B
Python
21 lines
523 B
Python
import xml.etree.ElementTree as ET
|
|
from bs4 import BeautifulSoup
|
|
|
|
def open_file(file_path):
|
|
|
|
|
|
|
|
with open(file_path, 'r') as f:
|
|
data = f.read()
|
|
Bs_data = BeautifulSoup(data, "xml")
|
|
b_unique = Bs_data.find_all('unique')
|
|
|
|
print(b_unique)
|
|
b_name = Bs_data.find('child', {'name':'Frank'})
|
|
|
|
print(b_name)
|
|
value = b_name.get('test')
|
|
|
|
print(value)
|
|
|
|
open_file("C:/Users/jze9/Documents/work/git/kadastr12/test/MapPlanTerritory_E2DF5B75-E136-48DA-BB4C-8887BA4ABF46.xml") |