慕沐1354941
2022-05-09 21:35
已经在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
先 import requests
Python3 进阶教程(新版)
41910 学习 · 236 问题
相似问题