dimanche 4 décembre 2016

python get xml from webservice

I'm trying to get a data from this site

and then use some of it. Sorry for not copy-paste it but its a long xml. So far I tried to get this data those ways:

from urllib.request import urlopen
url = "http://ift.tt/2g7RwGi?"
s = urlopen(url)
content = s.read()

as print(content) looks good, now I would like to get a data from it

<tabela_rozklad data-aktualizacji="1480583567">
<DZIEN>2</DZIEN>
<GODZ>3</GODZ>
<ILOSC>2</ILOSC>
<TYG>0</TYG>
<ID_NAUCZ>66</ID_NAUCZ>
<ID_SALA>79</ID_SALA>
<ID_PRZ>104</ID_PRZ>
<RODZ>W</RODZ>
<GRUPA>1</GRUPA>
<ID_ST>13</ID_ST>
<SEM>1</SEM>
<ID_SPEC>0</ID_SPEC>
</tabela_rozklad>

How can I handle this data to easy use it?




Aucun commentaire:

Enregistrer un commentaire