HENNGE / arsenic

Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Other
350 stars 53 forks source link

Chrome doesn't save its state correctly #48

Open nokados opened 5 years ago

nokados commented 5 years ago

Hello!

How to reproduce the issue:

  1. open chrome session with user-data-dir=FOLDER I do it like this:
        self.chrome_log = open('chrome.log', 'w')
        self.service = services.Chromedriver(log_file=self.chrome_log)
        self.browser = browsers.Chrome(chromeOptions={
            'args': ['--headless', '--disable-gpu', '-lang=ru', 
                     "--user-data-dir={}".format(self.user_dir), 
                     '--window-size={},{}'.format(WINDOW_WIDTH, WINDOW_HEIGHT)]
        })
  2. Visit some website and sign in there.
  3. Restart the script and visit this website again.

The Issue: We assume we will be signed in at the second visit, but you will see that you are not signed in. However, the folder for user data (history, bookmarks, and cookies, as well as other per-installation local state.) will be created.

That's interesting. If we sign in with selenium and then visit the website with arsenic using the same user-data-dir, we will be signed in. It means that chrome correctly loads the profile.

UPD: The same behaviour, when I try to sign out. After the restarting session, I am still signed in, although I successfully signed out during the previous session.

chrome.log

Starting ChromeDriver 2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5) on port 34409
Only local connections are allowed.
dimaqq commented 5 years ago

We love pull requests!