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

AttributeError:'模块'对象没有属性'urlopen'

AttributeError:'模块'对象没有属性'urlopen'

PIPIONE 2019-11-26 14:49:50
我正在尝试使用Python下载网站的HTML源代码,但收到此错误。Traceback (most recent call last):      File "C:\Users\Sergio.Tapia\Documents\NetBeansProjects\DICParser\src\WebDownload.py", line 3, in <module>     file = urllib.urlopen("http://www.python.org")AttributeError: 'module' object has no attribute 'urlopen'我在这里遵循指南:http : //www.boddie.org.uk/python/HTML.htmlimport urllibfile = urllib.urlopen("http://www.python.org")s = file.read()f.close()#I'm guessing this would output the html source code?print(s)我正在使用Python 3。
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 702 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信