执行读取时,URL打开读取挂断

时间:2018-11-06 00:21:01

标签: python-3.x

urlopen(req).read()在执行读取时挂断;我正在使用python3

from urllib.request import Request, urlopen

req = Request("https://www.accuweather.com/en/us/los-angeles-ca/90012/weather-forecast/347625", headers={'User-Agent': 'Mozilla/5.0'})
webpage = urlopen(req).read()
print(webpage)

任何指导都会受到赞赏

0 个答案:

没有答案