已经在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