Objective: Save the browser session/cookies to share them in multiples script execution.
I currently have this working using ChromeDriver: chrome_options = Options() chrome_options.add_argument("user-data-dir=" + os.path.dirname(sys.argv[0])) browser = webdriver.Chrome(chrome_options=chrome_options) This code tells Chrome to use a specific path, in my case the script path, as "data" folder where it stores everything, and NOT use the default approach where everything is temporary and deleted when the script exits. This way, I can login in the site I need once and exit the script. If I execute the script later everything is already saved and I don't have to login anymore. I need this approach because the site has a security measure where they send a key to my email everytime I login in a "new" PC. The issue: Now I need to use PhantomJS. I already tried this code: cookie_path = os.path.join(os.getcwd(), 'cookie.txt') driver = webdriver.WebDriver(service_args=['--cookies-file=cookies.txt']) But it doesn't work. I looked at the PhantomJS doc and on Google but didn't find anything. I hope someone knows better than me and could give me a "hand" here. Thanks.
-- https://mail.python.org/mailman/listinfo/python-list