为了账号安全,请及时绑定邮箱和手机立即绑定

AttributeError: module 'urllib.request' has no attribute 'urlopen'

from urllib import request import http.cookiejar url = 'http://www.baidu.com' print('第一种方法:') response1 = request.urlopen(url) print(response1.getcode()) print(len(response1.read())) 我的这么写会报错(AttributeError: module 'urllib.request' has no attribute 'urlopen')有大神帮看看吗?

正在回答

1 回答

是不是应该引入 urllib2

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Python开发简单爬虫
  • 参与学习       227586    人
  • 解答问题       1288    个

本教程带您解开python爬虫这门神奇技术的面纱

进入课程

AttributeError: module 'urllib.request' has no attribute 'urlopen'

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号