Python 3:
import urllib.requestcontents = urllib.request.urlopen("http://example.com/foo/bar").read()Python 2:
import urllib2contents = urllib2.urlopen("http://example.com/foo/bar").read()urllib.request和的文档
read。

Python 3:
import urllib.requestcontents = urllib.request.urlopen("http://example.com/foo/bar").read()Python 2:
import urllib2contents = urllib2.urlopen("http://example.com/foo/bar").read()urllib.request和的文档
read。