zoukankan      html  css  js  c++  java
  • python3.x中的urllib模块

    来源http://my.oschina.net/u/999436/blog/113317

    我尝试着找找python3.3.0的change log。里面并没有找到urllib的修改记录。然而这一修改记录却在python3.0的change log中。 
    原文是这样写的:


    a new urllib package was created. It consists of code from 
    urlliburllib2urlparse, and robotparser. The old 
    modules have all been removed. The new package has five submodules: 
    urllib.parseurllib.requesturllib.response
    urllib.error, and urllib.robotparser. The 
    urllib.request.urlopen() function uses the url opener from 
    urllib2. (Note that the unittests have not been renamed for the 
    beta, but they will be renamed in the future.)


    原来,3.0版本中已经将urllib2、urlparse、和robotparser并入了urllib中,并且修改urllib模块,其中包含5个子模块,即是help()中看到的那五个名字。

    为了今后使用方便,在此将每个包中包含的方法列举如下: 
    urllib.error: ContentTooShortError; HTTPError; URLError

    urllib.parse: parse_qs; parse_qsl; quote; quote_from_bytes; quote_plus; unquote

                      unquote_plus; unquote_to_bytes; urldefrag; urlencode; urljoin; urlparse;
                      urlsplit; urlunparse; urlunsplit
    

    urllib.request: AbstractBasicAuthHandler; AbstractDigestAuthHandler; BaseHandler;

                        CatheFTPHandler; FTPHandler; FancyURLopener; FileHandler;
                        HTTPBasicAuthHandler; HTTPCookieProcessor; HTTPDefaultErrorHandler;
                        HTTPDigestAuthHandler; HTTPErrorProcessorl; HTTPHandler;
                        HTTPPasswordMgr; HTTPPasswordMgrWithDefaultRealm;
                        HTTPRedirectHandler; HTTPSHandler;OpenerDirector;ProxyBasicAuthHandler
                        ProxyDigestAuthHandler;  ProxyHandler; Request; URLopener;
                        UnknowHandler; build_opener; getproxies; install_opener; pathname2url;
                        url2pathname; urlcleanup; urlopen; urlretrieve;
    

    urllib.response: addbase; addclosehook; addinfo; addinfourl;

    urllib.robotparser: RobotFileParser

    当然,python3.0的改动十分巨大,有需要可以参阅change log

  • 相关阅读:
    Linux下crontab详解
    Linux下mail/mailx命令发送邮件
    Linux下Mysql数据库备份
    Linux远程备份—ftp方式、NFS方式
    Fedora 17安装NFS
    Linux下vsftp服务器—上传、下载
    Linux中Kill进程的N种方法
    Linux命令执行顺序— ||和&&和;
    C#中override和overload的区别
    C#中派生类调用基类构造函数用法分析
  • 原文地址:https://www.cnblogs.com/hhj187/p/4692789.html
Copyright © 2011-2022 走看看