|
@@ -19,13 +19,14 @@ from handler.configHandler import ConfigHandler
|
|
|
def testProxyFetcher():
|
|
def testProxyFetcher():
|
|
|
conf = ConfigHandler()
|
|
conf = ConfigHandler()
|
|
|
proxy_getter_functions = conf.fetchers
|
|
proxy_getter_functions = conf.fetchers
|
|
|
|
|
+ proxy_counter = {_: 0 for _ in proxy_getter_functions}
|
|
|
for proxyGetter in proxy_getter_functions:
|
|
for proxyGetter in proxy_getter_functions:
|
|
|
- proxy_count = 0
|
|
|
|
|
for proxy in getattr(ProxyFetcher, proxyGetter.strip())():
|
|
for proxy in getattr(ProxyFetcher, proxyGetter.strip())():
|
|
|
if proxy:
|
|
if proxy:
|
|
|
- print('{func}: fetch proxy {proxy},proxy_count:{proxy_count}'.format(func=proxyGetter, proxy=proxy,
|
|
|
|
|
- proxy_count=proxy_count))
|
|
|
|
|
- proxy_count += 1
|
|
|
|
|
|
|
+ print('{func}: fetch proxy {proxy}'.format(func=proxyGetter, proxy=proxy))
|
|
|
|
|
+ proxy_counter[proxyGetter] = proxy_counter.get(proxyGetter) + 1
|
|
|
|
|
+ for key, value in proxy_counter.items():
|
|
|
|
|
+ print(key, value)
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|