import asyncio from proxybroker import Broker async def show(proxies): while True: proxy = await proxies.get() if proxy is None: break print('Found proxy: %s' % proxy) proxies = asyncio.Queue() broker=Broker(proxies) tasks=asyncio.gather(broker.find(types=['HTTP','HTTPS'],limit=10),show(proxies)) loop=asyncio.get_event_loop() loop.run_until_complete(tasks)
来源:博客园
作者:hankleo
链接:https://www.cnblogs.com/hankleo/p/11509591.html