python爬取天气1.0
本帖最后由 xiaosi4081 于 2020-5-27 18:32 编辑上代码:(回复“我爱鱼c”即可看到)
**** Hidden Message ***** 沙发!!{:10_256:} 可以用lazy_pinyin的
我爱鱼C 欧霍 看看 我爱鱼c 初来乍到,想问下第一行那个requests是什么意思。{:10_266:} 我爱鱼C
Strawberry.lyh 发表于 2020-5-27 20:16
初来乍到,想问下第一行那个requests是什么意思。
导入requests模块 看看 我爱鱼c 我爱鱼c 我爱鱼c 我爱鱼C 我把程序复制到pycharm中运行, 发现可以输入城市,有网页出来。 但是无法弹出后续的信息 。 这个需要怎么修改。 谢谢
请输入城市:上海
http://tianqi.com/shanghai/
上海 市天气预报
-----
Traceback (most recent call last):
File "C:/Users/Aqueti/PycharmProjects/Python Study/Python 联系程序/12.py", line 45, in <module>
get(city,city_start)
File "C:/Users/Aqueti/PycharmProjects/Python Study/Python 联系程序/12.py", line 32, in get
soup = BeautifulSoup(res,'lxml')
File "C:\Users\Aqueti\PycharmProjects\Python Study\venv\lib\site-packages\bs4\__init__.py", line 225, in __init__
raise FeatureNotFound(
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library? 请输入城市:上海
http://tianqi.com/shanghai/
上海 市天气预报
-----
Traceback (most recent call last):
File "C:/Users/Aqueti/PycharmProjects/Python Study/Python 联系程序/12.py", line 45, in <module>
get(city,city_start)
File "C:/Users/Aqueti/PycharmProjects/Python Study/Python 联系程序/12.py", line 32, in get
soup = BeautifulSoup(res,'lxml')
File "C:\Users\Aqueti\PycharmProjects\Python Study\venv\lib\site-packages\bs4\__init__.py", line 225, in __init__
raise FeatureNotFound(
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library? 我爱鱼C
bujust_h 发表于 2020-5-28 09:19
请输入城市:上海
http://tianqi.com/shanghai/
上海 市天气预报
cmd
pip install lxml 我爱鱼c