python 3.3.2报错:No module named 'urllib2' |
您所在的位置:网站首页 › python3没有urllib2 › python 3.3.2报错:No module named 'urllib2' |
请问我可以回答你的问题么?请参考下面的代码 import urllib.request resp=urllib.request.urlopen('http://www.baidu.com') html=resp.read() print(html)在python3.3里面,用urllib.request代替urllib2,另外python3之后,不能再用 print html这样的方式,因为print这个时候已经是一个方法了。必须使用下面的方法 print(html)供参考。 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |