为了账号安全,请及时绑定邮箱和手机立即绑定

name 'requests' is not defined

已经在cmd pip install requests了 为什么还会报错 服务器也启动了

response = requests.get('https//:127.0.0.1:8000')
content = str(response.content, encoding='utf-8') # ==> 打印具体内容
content_list = content.split('\n') # 分行
for line in content_list:
    if 'href' in line and 'www' in line:
        print(line.strip())


Traceback (most recent call last):

  File "D:\python\work\main.py", line 2, in <module>

    response = requests.get('https//:127.0.0.1:8000')

NameError: name 'requests' is not defined


正在回答

1 回答

先 import requests

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

name 'requests' is not defined

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号