Theurllib.error module defines the exception classes for exceptionsraised byurllib.request. The base exception class isURLError.
The following exceptions are raised byurllib.error as appropriate:
The handlers raise this exception (or derived exceptions) when they run intoa problem. It is a subclass ofOSError.
The reason for this error. It can be a message string or anotherexception instance.
Though being an exception (a subclass ofURLError), anHTTPError can also function as a non-exceptional file-like returnvalue (the same thing thaturlopen() returns). Thisis useful when handling exotic HTTP errors, such as requests forauthentication.
An HTTP status code as defined inRFC 2616. This numeric value correspondsto a value found in the dictionary of codes as found inhttp.server.BaseHTTPRequestHandler.responses.
This is usually a string explaining the reason for this error.
This exception is raised when theurlretrieve()function detects thatthe amount of the downloaded data is less than the expected amount (given bytheContent-Length header). Thecontent attribute stores thedownloaded (and supposedly truncated) data.
21.8.urllib.parse — Parse URLs into components
21.10.urllib.robotparser — Parser for robots.txt
Enter search terms or a module, class or function name.