Вы можете попробовать перебрать дочерние элементы soup.find('ns1:area')
, чтобы найти тег ns1:areaid
, а затем получить его текст.
for i in soup.find('ns1:area').children:
if i.name == "ns1:areaid":
b = i.text
print(b)
А из ns1:AffectedAreas
это будет выглядеть как
for i in soup.find_all('ns1:AffectedAreas'.lower()):
for child in i.children:
if child.name == "ns1:area":
for y in child.children:
if y.name == "ns1:areaid":
print(y.text)
Или найти тег ns1:AreaId
в нижнем регистре и получить его текст. таким образом вы можете получить все текстовые значения из всех тегов ns1:AreaId
.
soup.find_all("ns1:AreaId".lower())[0].text
В обоих случаях будет выведено
"10YDK-1--------W"