xiaosi4081 发表于 2020-5-27 18:30:25

python爬取天气1.0

本帖最后由 xiaosi4081 于 2020-5-27 18:32 编辑

上代码:(回复“我爱鱼c”即可看到)

**** Hidden Message *****

xiaosi4081 发表于 2020-5-27 18:34:47

沙发!!{:10_256:}

qiuyouzhi 发表于 2020-5-27 19:05:46

可以用lazy_pinyin的

ye411645681 发表于 2020-5-27 19:28:17

我爱鱼C

_2_ 发表于 2020-5-27 19:46:19

欧霍

aaron.yang 发表于 2020-5-27 19:51:52

看看

Strawberry.lyh 发表于 2020-5-27 20:13:16

我爱鱼c

Strawberry.lyh 发表于 2020-5-27 20:16:12

初来乍到,想问下第一行那个requests是什么意思。{:10_266:}

1052931869 发表于 2020-5-27 20:27:56

我爱鱼C

xiaosi4081 发表于 2020-5-28 07:24:58

Strawberry.lyh 发表于 2020-5-27 20:16
初来乍到,想问下第一行那个requests是什么意思。

导入requests模块

Mike_python小 发表于 2020-5-28 08:02:46

看看

mzx666 发表于 2020-5-28 08:46:00

我爱鱼c

均昊山 发表于 2020-5-28 08:56:10

我爱鱼c

bujust_h 发表于 2020-5-28 09:04:30

我爱鱼c

f1305147 发表于 2020-5-28 09:17:10

我爱鱼C

bujust_h 发表于 2020-5-28 09:17:59

我把程序复制到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?

bujust_h 发表于 2020-5-28 09:19:20

请输入城市:上海
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?

liuhewantong 发表于 2020-5-28 09:34:49

我爱鱼C

xiaosi4081 发表于 2020-5-28 12:29:29

bujust_h 发表于 2020-5-28 09:19
请输入城市:上海
http://tianqi.com/shanghai/
上海 市天气预报


cmd
pip install lxml

SweatDreams 发表于 2020-5-28 13:15:21

我爱鱼c
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: python爬取天气1.0