Code: Select all
,
Code: Select all
or
PD: My Das endgültige Ziel besteht darin, das XML in einer Datenbank abzulegen
XML GET:
Code: Select all
print("GETTING XML...")
resp = requests.get('http://infocar.dgt.es/datex2/dgt/SituationPublication/all/content.xml', stream = True) #XML that I need
if resp.status_code != 200:
raise ApiError('GET /tasks/ {}'.format(resp.status_code))
print("XML RECIBIDO 200 OK")
#resp.raw.decode_content = True
print("GUARDANDO XML")
with open("DGT_DATEX.xml", "wb") as handle:
for data in (resp.iter_content()):
handle.write(data)
dom = parse("DGT_DATEX.xml")