Urllib返回'没有此类文件或目录错误'

问题描述 投票:0回答:1

我试图通过URL访问某个“第三方”数据库,使用urllib.request库但我收到此错误:

<urlopen error [Errno 2] No such file or directory>

虽然我以前用同一个脚本能够多次访问该链接。

import urllib.request

def read_temp():
    url = "https://maturity.000webhostapp.com/api/temp/read_all.php"
    response = urllib.request.urlopen(url).read()
    json_obj = str(response, 'utf-8')
    data = json.loads(json_obj)

我希望脚本可以毫不费力地工作,但有时它无法连接。

python urllib
1个回答
1
投票

该网站已被所有者删除。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.