import urllib.request
try:
url='http://www.google.com'
url=urllib.request.urlopen(url,timeout=1)
url=url.read()
print(url)
except urllib.error.URLError as e:
print('出错了',str(e))
import urllib.request
try:
url='http://www.google.com'
url=urllib.request.urlopen(url,timeout=1)
url=url.read()
print(url)
except urllib.error.URLError as e:
print('出错了',str(e))
本文标题:链接超时:time out
本文链接:https://www.haomeiwen.com/subject/pvkspftx.html
网友评论