python代码:
import urllib2
response = urllib2.urlopen('http://www.baidu.com/')
html = response.read()
print html
报错如下:
Traceback (most recent call last):
File "", line 1, in
import urllib2
ImportError: No module named 'urllib2'
我下载的是最新版的,3.3.2
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
楼上正解,python3之后print已经成为一个函数,调用时需要加参数。print()