import asyncio import aiohttp from ssl import SSLCertVerificationError async def fetch_url(url, client): try: async with client.get(url) as resp: print(resp.status) print(await resp.read()) except SSLCertVerificationError as e: print('Error handled') async def main(urls): tasks = [] async with aiohttp.ClientSession(loop=loop) as client: for url in urls: task = asyncio.ensure_future(fetch_url(url, client)) tasks.append(task) return await asyncio.gather(*tasks) loop = asyncio.get_event_loop() loop.run_until_complete(main(['https://images.photos.com/']))