title: "asyncio.run() cannot be called from a running event loop" when using Jupyter Notebook
body: <p>I would like to use asyncio to get webpage html.</p>
  <p>I run the following code in jupyter notebook:</p>
  <pre><code>import aiofiles
  import aiohttp
  from aiohttp import ClientSession
  
  async def get_info(url, session):
      resp = await session.request(method=&quot;GET&quot;, url=url)
      resp.raise_for_status()
      html = await resp.text(encoding='GB18030')
      with open('test_asyncio.html', 'w', encoding='utf-8-sig') as f:
          f.write(html)
      return html
      
  async def main(urls):
      async with ClientSession() as session:
          tasks = [get_info(url, session) for url in urls]
          return await asyncio.gather(*tasks)
  
  if __name__ == &quot;__main__&quot;:
      url = ['http://huanyuntianxiazh.fang.com/house/1010123799/housedetail.htm', 'http://zhaoshangyonghefu010.fang.com/house/1010126863/housedetail.htm']
      result = asyncio.run(main(url))
  </code></pre>
  <p>However, it returns <code>RuntimeError: asyncio.run() cannot be called from a running event loop</code></p>
  <p>What is the problem?</p>
  <p>How to solve it?</p>