try page urllib urlopen url data http http proxy read login re findall

1
2
3
4
5
6
7
8
9
try:
page = urllib.urlopen(url, data, {'http': 'http://' + proxy}).read()
login = re.findall('Login successfully', page)
except:
proxy = get_proxy()
print 'Forced change proxy...'
print 'Proxy: ' + proxy
page = urllib.urlopen(url, data, {'http': 'http://' + proxy}).read()
login = re.findall('Login successfully', page)