如何从python中简单地下载HTTP文件

时间:2017-04-30 15:56:20

标签: python-3.x wget urllib

我正在尝试使用FILEBROWSER_MAX_UPLOAD_SIZE,但我收到以下错误:

urllib.request

使用不同的超时更改。 >>> from urllib.request import urlopen >>> urlopen(url, timeout=5) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.4/urllib/request.py", line 161, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.4/urllib/request.py", line 469, in open response = meth(req, response) File "/usr/lib/python3.4/urllib/request.py", line 579, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python3.4/urllib/request.py", line 507, in error return self._call_chain(*args) File "/usr/lib/python3.4/urllib/request.py", line 441, in _call_chain result = func(*args) File "/usr/lib/python3.4/urllib/request.py", line 587, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 504: Gateway Time-out python模块给出了同样的错误。但如果我只是使用:

wget

它就像一个魅力。但是,我不想使用它,因为我的应用程序必须是独立于平台的。

有什么想法吗?

0 个答案:

没有答案