天气查询器
没有用到爬虫哦 ^.^import webbrowser
while True:
city = input("请输入要查询的城市的拼音:")
option = input("1-天气,2-雾霾(1 或 2):")
if option == 1:
address = "http://www.tianqi.com/" + city
break
elif option:
address = "http://www.86pm25.com/city/" + city+ ".html"
break
else:
print("输入错误,请重新输入!")
continue
webbrowser.open(address)
页:
[1]