📜  使用 Python 代码示例的智能天气信息应用程序

📅  最后修改于: 2022-03-11 14:47:07.787000             🧑  作者: Mango

代码示例1
soup = BeautifulSoup(res.text,'html.parser')   
    location = soup.select('#wob_loc')[0].getText().strip()  
    current_time = soup.select('#wob_dts')[0].getText().strip()       
    info = soup.select('#wob_dc')[0].getText().strip() 
    weather = soup.select('#wob_tm')[0].getText().strip()
    information = f"{location} \n {current_time} \n {info} \n {weather} °C "