from urllib import request def fetch_xml(): with request.urlopen('http://weather.yahooapis.com/forecastrss?u=c&w=2151330') as f: data = f.read() d={} for k, v in f.getheaders(): d[k]=v d['Data']=data.decode('utf-8') return d print(fetch_xml())
Sign in to make a reply
拉擦擦啊粒打打