Python module providing a high-level interface for fetching data across the World Wide Web. Predecessor to urllib2. In Python 3, urllib2 and urllib have been reorganized and merged into urllib.
For Python 2, the urllib
module is the predecessor of the urllib2
module, while the latter still uses some functionality of the former.
For Python 3, the urllib
package was reorganized. It now has no content of its own. All methods and classes are in several submodules:
urllib.request
for opening and reading URLsurllib.error
containing the exceptions raised byurllib.request
urllib.parse
for parsing URLsurllib.robotparser
for parsingrobots.txt
files
Note that urllib2 doesn't exist in Python 3 anymore.