Python3.3中的urllib

在python3.3中urllib和2.x版本中有很大区别,在3.0的change log中提到

a new urllib package was created. Itconsists of code from urllib, urllib2, urlparse, and robotparser. The old modules have all beenremoved. The new package has five submodules: urllib. parse, urllib.request, urllib.response, urllib.error,urllib.robotparser. The urllib.request.urlopen() function uses the url openerfrom urllib2. (Note that the unittestshave not been renamed for the beta, but they will berenamed in the future.)

3.0版本中已经将urllib2、urlparse、和robotparser并入了urllib中,并且修改urllib模块,其中包含5个子模块,

以前的url.open()现在修改为 data = urllib.request.urlopen(line)
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值