title: Click button, then scrape data on seemingly static webpage?
body: <p>I'm trying to scrape the player statistics in the <code>Totals</code> table at this link: <a href="http://www.basketball-reference.com/players/j/jordami01.html" rel="nofollow">http://www.basketball-reference.com/players/j/jordami01.html</a>. It's much more difficult to scrape the data as-is when you first appear on that site, so you have the option of clicking 'CSV' right above the table. This format would be much easier to digest.</p>
  
  <p>I'm having trouble </p>
  
  <pre><code>import urllib2
  from bs4 import BeautifulSoup
  from selenium import webdriver
  
  player_link = "http://www.basketball-reference.com/players/j/jordami01.html"
  
  browser = webdriver.Firefox()
  browser.get(player_link)
  elem = browser.find_element_by_xpath("//span[@class='tooltip' and @onlick='table2csv('totals')']")
  elem.click()
  </code></pre>
  
  <p>When I run this, a Firefox window pops up, but the code never changes the table from its original format to CSV. The CSV table only pops up in the source code after I click CSV (obviously). How can I get <code>selenium</code> to click that CSV button and then BS to scrape the data?</p>