Skip to content

Instantly share code, notes, and snippets.

@SEJeff
Created June 17, 2013 14:24
Show Gist options
  • Save SEJeff/5797270 to your computer and use it in GitHub Desktop.
Save SEJeff/5797270 to your computer and use it in GitHub Desktop.
Forcing splinter to download a file
cls.browser_prefs = {
# Silence the "Unresponsive script" dialogs
"dom.max_chrome_script_run_time": 600,
"dom.max_script_run_time": 600,
"browser.download.folderList": 2,
# We actually download CSV files from search results
# to verify the search functionality works as expected
"browser.download.dir": tempfile.mkdtemp(),
"browser.download.manager.showWhenStarting": False,
"browser.helperApps.neverAsk.saveToDisk": "text/csv,application/csv,text/plain",
}
cls.browser = Browser('firefox', profile_preferences=cls.browser_prefs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment