我的代码非常简单,就是为了试试能不能成功读整个网页
def pullData(SettingsFile):
url = 'https://www.google.ie'
try:
proxy,_,_ = get_config(SettingsFile)
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
req = urllib2.Request(url)
responce = urllib2.urlopen(req, timeout=20).read().decode('utf-8')
print responce.read()
except (urllib2.HTTPError, urllib2.URLError) as error:
print str(error)
except timeout:
print('socket timed out - URL %s', url)
else:
print('Access successful.')
pullData("settings.ini")
但是error 提示<urlopen error [Error 97] Address family not supported by protocol> 有没有大神知道这是什么意思,我该怎么做