The idea is to get the value of tag endTime for the following xml:
<epochs xmlns="http://www.egi.com/epochs_mff" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<epoch>
<beginTime>0</beginTime>
<endTime>3586221000</endTime>
<firstBlock>1</firstBlock>
<lastBlock>897</lastBlock>
</epoch>
<epoch>
<beginTime>3750143000</beginTime>
<endTime>5549485000</endTime>
<firstBlock>898</firstBlock>
<lastBlock>1347</lastBlock>
</epoch>
</epochs>
Yet, accessing the tag directly return an empty list:
import xml.etree.ElementTree as ET
tree = ET.parse(r'epochs.xml')
epoch_list=tree.findall("epoch")
However, looping through the tree does return the endTime value.
import xml.etree.ElementTree as ET
tree = ET.parse(r'epochs.xml')
for elem in tree:
for subelem in elem:
print(subelem.text)
May I know how can I retrieve directly the endTime with the value of 300937000?
result = soup_page.find_all("endtime").