Created
February 20, 2018 06:39
-
-
Save rskelley9/c476bc066851b10c08d79588aa42c7e0 to your computer and use it in GitHub Desktop.
Python script for downloading steamer data on FG website.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time; | |
from selenium import webdriver; | |
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile; | |
profile = FirefoxProfile(); | |
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", 'text/csv'); | |
driver = webdriver.Firefox(firefox_profile=profile); | |
driver.get("https://www.fangraphs.com/projections.aspx?pos=all&stats=bat&type=steamer&team=0&lg=all&players=0"); | |
driver.find_element_by_link_text('Export Data').click(); | |
## leave browser open for 10 seconds then close | |
time.sleep(10) | |
driver.quit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment