获取您的
Python
服务器
×
更改方向
更改主题,暗/亮
转到 Spaces
import requests #enter a wrong url: url = 'https://w3schools.org.cn/python/demopagdddddd.htm' x = requests.get(url) print(x.raise_for_status())
回溯(最近一次调用最后)
文件 "demo_request_response_raise_for_status.py",第 7 行,在 <模块>
print(x.raise_for_status())
文件 "C:\Users\MyName\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\models.py",第 940 行,在 raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 客户端错误:未找到 URL:https://w3schools.org.cn/python/demopagdddddd.htm