title: How to wait for a coroutine to finish and continue on its result?
body: <p>I have a coroutine sending web requests and post process them. Currently I'm doing:</p>
  
  <pre><code>async def scrape(url, sess, logging=None):
      # request
      result = sess.get(url, headers=headers(url))
      # process
      if result.ok:
          await(post_process(result.content))
  
  async def main():
      # code here
      for url in urls:
          await asyncio.create_task(scrape(url, sess))
  
  if __name__ == '__main__':
      loop = asyncio.get_event_loop()
      loop.run_until_complete(main())
  </code></pre>
  
  <p>The problem is it <em>is</em> running slowly! Seems the requests are blocking the loop. How can I turn requests to coroutines and wait for it to complete? </p>
  
  <p><strong>Note:</strong> I did google it. But I haven't find a concise example to do this. Also, I am using <code>requests</code> and <a href="https://stackoverflow.com/questions/9110593/asynchronous-requests-with-python-requests">some searches</a> show it's causing the trouble.</p>