Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with transfer_session_cookies_to_driver() #41

Closed
Abd0s opened this issue May 9, 2019 · 4 comments · Fixed by #42 or jimmy927/requestium#1
Closed

error with transfer_session_cookies_to_driver() #41

Abd0s opened this issue May 9, 2019 · 4 comments · Fixed by #42 or jimmy927/requestium#1

Comments

@Abd0s
Copy link

Abd0s commented May 9, 2019

When I try to use transfer_session_cookies_to_driver() to transfer my session to a driver I get the following error. Seems like this is a bug with the lib?

  File "src\gevent\greenlet.py", line 716, in gevent._greenlet.Greenlet.run
  File "C:\Users\Abdos\AppData\Local\Programs\Python\Python36\lib\site-packages\eel\__init__.py", line 191, in _process_message
    return_val = _exposed_functions[message['name']](*message['args'])
  File "C:\Users\Abdos\Documents\GitHub\Bol.com-AIbot\src\main.py", line 113, in bot_start
    s.transfer_session_cookies_to_driver()
  File "C:\Users\Abdos\AppData\Local\Programs\Python\Python36\lib\site-packages\requestium\requestium.py", line 114, in transfer_session_cookies_to_driver
    'expiry': c.expires, 'domain': c.domain})
  File "C:\Users\Abdos\AppData\Local\Programs\Python\Python36\lib\site-packages\requestium\requestium.py", line 235, in ensure_add_cookie
    self.add_cookie(cookie)
  File "C:\Users\Abdos\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 894, in add_cookie
    self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict})
  File "C:\Users\Abdos\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Abdos\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry'
@jimmy927
Copy link

I got the same issue.

This fix solves the issue for now, not really sure about the implications though, but i use it.

jimmy927@596db69

@jschnurr
Copy link
Contributor

As described in detail here, the cookie specs say values should not be null, and chromedriver 2.46 started enforcing that. To resolve, we remove any properties of the cookie with a value of None before invoking the webdriver.

Resolved by PR #42.

@hffaust
Copy link

hffaust commented Sep 28, 2019

I actually encountered this error and fixed it by simply changing 'expiry' to 'expires' ...

@OYin-Quest
Copy link

OYin-Quest commented Dec 5, 2019

I actually encountered this error and fixed it by simply changing 'expiry' to 'expires' ...

Is the 'expiry/expires' value correctly set in cookie? I change 'expiry' to 'expires' can bypass the error, but value is not set correctly. (using chrome driver 78.0.3904.108)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants