pfm & tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

32 lines
678 B

import requests
import xml.dom.minidom as minidom
import xml.etree.ElementTree as ET
url = 'https://www.cbr-xml-daily.ru/daily_utf8.xml'
r = requests.get(url)
root = ET.fromstring(r.content.decode())
result = {}
for child in root:
result[child.find("CharCode").text] = child.find("Value").text
print(result)
# node = doc.documentElement
# names = doc.getElementsByTagName("name")
#
# my_list = []
# for name in names:
# titleObj = book.getElementsByTagName("title")[0]
# titles.append(titleObj)
#
# for title in titles:
# nodes = title.childNodes
# for node in nodes:
# if node.nodeType == node.TEXT_NODE:
# print(node.data)
#
#
#
#