urllib.FancyURLopener¶
-
class
urllib.FancyURLopener(*args, **kwargs)[source]¶ Derived class with handlers for errors we can handle (perhaps).
Methods¶
__del__() |
|
__init__(*args, **kwargs) |
|
addheader(*args) |
Add a header to be used by the HTTP interface only e.g. |
cleanup() |
|
close() |
|
get_user_passwd(host, realm[, clear_cache]) |
|
http_error(url, fp, errcode, errmsg, headers) |
Handle http errors. |
http_error_301(url, fp, errcode, errmsg, headers) |
Error 301 – also relocated (permanently). |
http_error_302(url, fp, errcode, errmsg, headers) |
Error 302 – relocated (temporarily). |
http_error_303(url, fp, errcode, errmsg, headers) |
Error 303 – also relocated (essentially identical to 302). |
http_error_307(url, fp, errcode, errmsg, headers) |
Error 307 – relocated, but turn POST into error. |
http_error_401(url, fp, errcode, errmsg, headers) |
Error 401 – authentication required. |
http_error_407(url, fp, errcode, errmsg, headers) |
Error 407 – proxy authentication required. |
http_error_default(url, fp, errcode, errmsg, ...) |
Default error handling – don’t raise an exception. |
open(fullurl[, data]) |
Use URLopener().open(file) instead of open(file, ‘r’). |
open_data(url[, data]) |
Use “data” URL. |
open_file(url) |
Use local file or FTP depending on form of URL. |
open_ftp(url) |
Use FTP protocol. |
open_http(url[, data]) |
Use HTTP protocol. |
open_https(url[, data]) |
Use HTTPS protocol. |
open_local_file(url) |
Use local file. |
open_unknown(fullurl[, data]) |
Overridable interface to open unknown URL type. |
open_unknown_proxy(proxy, fullurl[, data]) |
Overridable interface to open unknown URL type. |
prompt_user_passwd(host, realm) |
Override this in a GUI environment! |
redirect_internal(url, fp, errcode, errmsg, ...) |
|
retrieve(url[, filename, reporthook, data]) |
retrieve(url) returns (filename, headers) for a local object |
retry_http_basic_auth(url, realm[, data]) |
|
retry_https_basic_auth(url, realm[, data]) |
|
retry_proxy_http_basic_auth(url, realm[, data]) |
|
retry_proxy_https_basic_auth(url, realm[, data]) |