Xml, extract ids with Python

0

I need to extract only the site_id and imps24ad. I can not filter by item id the way I am doing. Use python 2.7

<lista>
<sitio sitio_id="58384">
<ultimas24hrs>
<item id="imps24ad">10091559</item>
<item id="clicks24">1041</item>

Code:

for item in soup.find_all(['sitio_id', 'ultimas24hrs']):
    print item.text

58384
10091559
1041
    
asked by Martin Bouhier 01.06.2018 в 21:13
source

0 answers