python - Using urllib and minidom to fetch XML data -


I'm trying to get data from an XML service ... it's one.

I am using urrlib and minidom and I can not seem to make it work. I have used minidom with files and do not have URL

This is a code trying to use

  xmlurl = 'http: //xmlweather.vedur .is 'xmlpath = xmlurl +'? Op_w = xml and type = forec & lang = & amp; See = xml & amp; Id = '+ str (space) xmldoc = minidom.parse (urllib.urlopen (xmlpath))  

Can someone help me?

The following should be done (or at least give you a strong idea about what is going wrong Should):

xml.dom.minidom import parse import urllib xmlurl = 'http://xmlweather.vedur.is' xmlpath = xmlurl +'? Op_w = xml and type = forec & amp; Lang = is & amp; See = xml & amp; ; Ids = '+ str (try): xml = urllib.urlopen (xmlpath) dom = parse (xml) Exception as E: print (e)

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -