在Python3.5中urllib已经被整合了
具体官方文档:
a new urllib package was created. It consists of code from
urllib, urllib2, urlparse, and robotparser. The old
modules have all been removed. The new package has five submodules:
urllib.parse, urllib.request, urllib.response,
urllib.error, and urllib.robotparser. The
urllib.request.urlopen() function uses the url opener from
urllib2. (Note that the unittests have not been renamed for the
beta, but they will be renamed in the future.)
urlopen()用法:
import urllib.request
url=”http://www.baidu.com”
get=urllib.request.urlopen(url).read()
print(get)