title: Get aiohttp results as string
body: <p>I'm trying to get data from a website using async in python. As an example I used this code (under A Better Coroutine Example): <a href="https://www.blog.pythonlibrary.org/2016/07/26/python-3-an-intro-to-asyncio/" rel="nofollow noreferrer">https://www.blog.pythonlibrary.org/2016/07/26/python-3-an-intro-to-asyncio/</a></p>
  
  <p>Now this works fine, but it writes the binary chunks to a file and I don't want it in a file. I want the resulting data directly. But I currently have a list of coroutine objects which I can not get the data out of.</p>
  
  <p>The code:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import aiohttp
  import asyncio
  import async_timeout
  
  async def fetch(session, url):
      with async_timeout.timeout(10):
          async with session.get(url) as response:
              return await response.text()
  
  
  async def main(loop, urls):
      async with aiohttp.ClientSession(loop=loop) as session:
          tasks = [fetch(session, url) for url in urls]
          await asyncio.gather(*tasks)
          return tasks
  
  # time normal way of retrieval
  if __name__ == '__main__':
      urls = [a list of urls..]
  
      loop = asyncio.get_event_loop()
      details_async = loop.run_until_complete(main(loop, urls))
  </code></pre>
  
  <p>Thanks</p>