eggplants / get-pixivpy-token

Get your Pixiv token easily (for running upbit/pixivpy)
MIT License
117 stars 9 forks source link

Fix TypeError due to executable_path deprecation since Selenium 4.10.0 #114

Closed exentio closed 9 months ago

exentio commented 9 months ago

Trying to login using the library currently results in this error:

Traceback (most recent call last):
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/test.py", line 208, in <module>
    res = g.login(headless=True, username=PIXIV_EMAIL, password=PIXIV_PASSWORD)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/gppt/_selenium.py", line 75, in login
    self.driver = webdriver.Chrome(
                  ^^^^^^^^^^^^^^^^^
TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'

As often stated in Selenium logs before until the release of the 4.10.0 version, this is due to the deprecation of the executable_path parameter used in the get-pixivpy-token/gppt/_selenium.py file. The solution is to use a Service object instead.

The problem occurred due to lack of attention to the deprecation warnings, but also because a bot is constantly updating the dependencies and releases are being made without any test beforehand. I highly suggest interrupting the use of these bots or at least to introduce some testing methodology.