# --coding:utf-8--
from urllib import request
resp = request.urlopen("https://www.sougou.com/")
print(resp.read())
输出结果错误:
Traceback (most recent call last):
File "E:\PythonProjects\MyStudy\paChong\urllibStudy.py", line 5, in <module>
resp = request.urlopen("https://www.sougou.com/")
File "E:\Program Files\Python310\lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "E:\Program Files\Python310\lib\urllib\request.py", line 525, in open
response = meth(req, response)
File "E:\Program Files\Python310\lib\urllib\request.py", line 634, in http_response
response = self.parent.error(
File "E:\Program Files\Python310\lib\urllib\request.py", line 563, in error
return self._call_chain(*args)
File "E:\Program Files\Python310\lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
File "E:\Program Files\Python310\lib\urllib\request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Process finished with exit code 1
请问这是什么错误,一样的代码其他人运行没什么问题