我正在尝试从 XML 服务中获取数据……这个。
http://xmlweather.vedur.is/?op_w=xml&type=forec&lang=is&view=xml&ids=1
我正在使用 urrlib 和 minidom,但我似乎无法让它工作。我在文件中使用了 minidom,而不是 url。
这是我试图使用的代码
xmlurl = 'http://xmlweather.vedur.is'
xmlpath = xmlurl + '?op_w=xml&type=forec&lang=is&view=xml&ids=' + str(location)
xmldoc = minidom.parse(urllib.urlopen(xmlpath))
谁能帮我?