title: python selenium wait for page to load
body: <p>I've written a script that gets data from a page, but sometimes the page takes time to load and so when it pull the html into a soup object sometimes It pulls nothing as the page still needs to finish.</p>
  
  <p>I wrote the following code for waiting the page to finish.</p>
  
  <pre><code>def scrape_page(url):
       browser.get(url)    
       try:
          WebDriverWait(browser, 10).until(EC.presence_of_element_located(browser.find_element_by_id ("selection-box")))
          #Extract Source Code 
          html = browser.page_source;
          soup = BeautifulSoup(html)
  </code></pre>
  
  <p>It works </p>
  
  <p>But I'm getting the following error when I call the function;</p>
  
  <pre><code>TypeError: find_element() argument after * must be a sequence, not WebElement
  </code></pre>