У меня есть XML-файл, который выглядит следующим образом:
Study design
This is a secondary analysis of the Childhood Acute Illness and Nutrition (CHAIN) Network prospective cohort which, between November 2016 and January 2019, recruited 3101 children at nine hospitals in Africa and South Asia: Dhaka and Matlab Hospitals (Bangladesh), Banfora Referral Hospital (Burkina Faso), Kilifi County, Mbagathi County and Migori County Hospitals (Kenya), Queen Elizabeth Hospital (Malawi), Civil Hospital (Pakistan), and Mulago National Referral Hospital (Uganda). As described in the published study protocol,
11
children were followed throughout hospital admission and after discharge with follow-up visits at 45, 90 and 180-days post-discharge. Catchment settings differed in urbanisation, access to health care and prevalence of background comorbidities such as HIV and malaria. Prior to study start, sites were audited to optimise care as per national and World Health Organisation (WHO) guidelines.
12
Cross-network harmonisation of clinical definitions and methods was prioritised through staff training and the use of standard operation procedures and case report forms (available online,
https://chainnetwork.org/resources/
).
Как извлечь текст из элемента
с помощью BeautifulSoup?
Решение этой проблемы с помощью код ниже, похоже, не работает.
with open('test.xml', 'r') as file:
soup = BeautifulSoup(file, 'xml')
# Find and print all tags
for tag in soup.find_all('sec'):
print(tag.text)
Подробнее здесь: https://stackoverflow.com/questions/793 ... utifulsoup
Как извлечь текстовое содержимое из тега XML с помощью beautifulsoup ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение