首页 > 代码库 > python网络

python网络

try:
    import urllib.request as urllib2
except ImportError:
    import urllib2


response = urllib2.urlopen("http://www.baidu.com")
print(response.getcode())

 

python网络