我正在尝试为下面的代码实现代理,我该怎么做?该程序用于检查未使用和已使用的Steam ID。
base_url = 'http://steamcommunity.com/id/'
def pad_right(string, n_chars):
return string + (' ' * (n_chars - len(string)))
class Id:
def __init__(self, url):
req = request.Request(url, headers={'User-Agent':'Mozilla/5.0'})
html = request.urlopen(req).read().decode('utf-8')
self.exist = not 'The specified profile could not be found.' in html