pythonでxmlファイルのtextの部分を抽出するプログラムの作成

<passage> <infon key="section_type">ABSTRACT</infon> <infon key="type">abstract</infon> <offset>81</offset> <text>Neurologic complications of COVID-19 infection have been recently described and include dizziness, headache, loss of taste and smell, stroke, and encephalopathy. Brain MRI in these patients have revealed various findings including ischemia, hemorrhage, inflammation, and demyelination. In this article, we report a case of critical illness-associated cerebral microbleeds identified on MRI in a patient with severe COVID-19 infection and discuss the potential etiologies of these neuroimaging findings.</text>                ・  
・ <passage>

実現したいこと

pythonでresult.xmlというファイルのtextの部分を抽出するプログラムを作成したい.

該当のソースコード

ソースコード
import xml.etree.ElementTree as ET
tree = ET.parse('result.xml')

コメントを投稿

0 コメント