name 'requests' is not defined
已經(jīng)在cmd pip install requests了 為什么還會報錯 服務器也啟動了
response?=?requests.get('https//:127.0.0.1:8000') content?=?str(response.content,?encoding='utf-8')?#?==>?打印具體內(nèi)容 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
2022-06-13
先 import requests