title: Scheduling coroutines with asyncio in Python
body: <p>I have the following code which scrapes a web table with 1000 lines and 10 columns.
  I have successfully generated a dataframe using nested for loops, but it takes well over three minutes.
  In a (futile) attempt to save time, I have ventured into asyncio, watched several videos, andread many tutorials. I can't seem to figure out a structure which will make this work. Everything online is ultra simplistic and not terribly explicit.
  Currently I get an error that a future is asked for without an await on the line creating the data frame.</p>
  <p>What am I missing to get the rows and cells asyncronously?</p>
  <pre><code># Wait on the table to load so we know all the data is there.
  WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, '//table/tbody')))
  
  # Determine the number of rows and columns
  rows = driver.find_elements(By.XPATH, '//table/tbody/tr')
  cols = driver.find_elements(By.XPATH, '//table/tbody/tr[1]/td')
  
  # use a list comprehension for each row and gather all the rows
  result = asyncio.create_task(startgathering(driver, len(cols), len(rows)))
  names = ['A', 'B', 'C', 'D', 'E', 'F','G', 'H', 'I']
  df = pd.DataFrame(result, columns=names)  # Error occurs here
  driver.quit()
  
  
  async def startgathering(driver, ncols, nrows):
      result = await asyncio.gather(*[getrows(driver, i, ncols) for i in range(1, nrows)])
      return result
  
  
  async def getrows(driver, i, ncols):
      lrow = await asyncio.gather(*[driver.find_element(By.XPATH, f'//table/tbody/tr[{i}]/td[{j}]')
                  .text for j in range(1, ncols)])
      return lrow
  
  </code></pre>