title: Downloading dynamically loaded webpage with python
body: <p>I have this <a href="http://site.co.uk#" rel="nofollow">website</a> and I want to download the content of the page.</p>
  
  <p>I tried <strong>selenium</strong>, and button clicking with it, but with no success.</p>
  
  <pre><code>#!/usr/bin/env python
  from contextlib import closing
  from selenium.webdriver import Firefox
  import time
  
  # use firefox to get page with javascript generated content
  with closing(Firefox()) as browser:
      # setting the url
      browser.get("http://bonusbagging.co.uk/oddsmatching.php#")
      # finding and clicking the button
      button = browser.find_element_by_id('select_button')
      button.click()
      page = browser.page_source
      time.sleep(5)
      print(page.encode("utf8"))
  </code></pre>
  
  <p>This code only downloads the source code, where the data are hidden.</p>
  
  <p>Can someone show me the right way to do that? Or tell my how can be the hidden data downloaded?</p>
  
  <p>Thanks in advance!</p>