def Get_weather(city):
url = 'http://wthrcdn.etouch.cn/WeatherApi?city=' + urllib.parse.quote(city)
weather = urllib.request.urlopen(url).read()
weather_data = gzip.decompress(weather).decode('utf-8')
soup = BeautifulSoup(weather_data)
return soup
评论列表
文章目录