Created
October 3, 2014 20:57
-
-
Save blaix/aaf1466eb8b02a8f971c to your computer and use it in GitHub Desktop.
Download file in a selenium session that requires a cookie from that session
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
# http://selenium-python.readthedocs.org/en/latest/api.html?highlight=cookie#selenium.webdriver.remote.webdriver.WebDriver.get_cookie | |
cookie = driver.get_cookie("cookie_name") | |
subprocess.check_call(["curl", "--cookie", "cookie_name=%" % cookie["value"], url, "-o", "destination_filename") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment