Python2 Python3 Urllib Method correspondence

Source: Internet
Author: User

Python2 name Python3 Name
Urllib.urlopen () Urllib.request.urlopen ()
Urllib2.urlopen () Urllib.request.urlopen ()
Urllib.urlretrieve () Urllib.request.urlretrieve ()
Urllib.urlcleanup () Urllib.request.urlcleanup ()
Urllib.quote () Urllib.parse.quote ()
Urllib.quote_plus () Urllib.parse.quote_plus ()
Urllib.unquote () Urllib.parse.unquote ()
Urllib.unquote_plus () Urllib.parse.unquote_plus ()
Urllib.urlencode () Urllib.parse.urlencode ()
Urllib.pathname2url () Urllib.request.pathname2url ()
Urllib.url2pathname () Urllib.request.url2pathname ()
Urllib.getproxies () urllib.request.getproxies ()
Urllib. Urlopener Urllib.request.URLopener
Urllib. Fancyurlopener Urllib.request.FancyURLopener
Urllib. Contenttooshorterror Urllib.error.ContentTooShortError
Urllib2.urlopen () Urllib.request.urlopen ()
Urllib2.install_opener () Urllib.request.install_opener ()
Urllib2.build_opener () Urllib.request.build_opener ()
Urllib2. Urlerror Urllib.error.URLError
Urllib2. Httperror Urllib.error.HTTPError
Urllib2. Request Urllib.request.Request
Urllib2. Openerdirector Urllib.request.OpenerDirector
Urllib2. Basehandler Urllib.request.BaseHandler
Urllib2. Httpdefaulterrorhandler Urllib.request.HTTPDefaultErrorHandler
Urllib2. Httpredirecthandler Urllib.request.HTTPRedirectHandler
Urllib2. Httpcookieprocessor Urllib.request.HTTPCookieProcessor
Urllib2. Proxyhandler Urllib.request.ProxyHandler
Urllib2. Httppasswordmgr URLLIB.REQUEST.HTTPPASSWORDMGR
Urllib2. Httppasswordmgrwithdefaultrealm Urllib.request.HTTPPasswordMgrWithDefaultRealm
Urllib2. Abstractbasicauthhandler Urllib.request.AbstractBasicAuthHandler
Urllib2. Httpbasicauthhandler Urllib.request.HTTPBasicAuthHandler
Urllib2. Proxybasicauthhandler Urllib.request.ProxyBasicAuthHandler
Urllib2. Abstractdigestauthhandler Urllib.request.AbstractDigestAuthHandler
Urllib2. Httpdigestauthhandler Urllib.request.HTTPDigestAuthHandler
Urllib2. Proxydigestauthhandler Urllib.request.ProxyDigestAuthHandler
Urllib2. HttpHandler Urllib.request.HTTPHandler
Urllib2. Httpshandler Urllib.request.HTTPSHandler
Urllib2. Filehandler Urllib.request.FileHandler
Urllib2. Ftphandler Urllib.request.FTPHandler
Urllib2. Cacheftphandler Urllib.request.CacheFTPHandler
Urllib2. Unknownhandler Urllib.request.UnknownHandler

Python2 Python3 Urllib Method correspondence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.