haltakov / simple-photo-gallery

Beautiful and simple photo galleries that help you tell your story. Free and open-source.
https://haltakov.net/simple-photo-gallery
MIT License
194 stars 51 forks source link

Selenium 4.10 incompatible with webdriver code #135

Closed kroesche closed 4 months ago

kroesche commented 6 months ago

Generating a gallery with a google photos album. Using fresh install of SPG with latest dependencies:

Building the Simple Photo Gallery...
Generating thumbnails...
Generating the images_data.json file...
Starting Firefox webdriver...
Something went wrong while generating the images_data.json file:
WebDriver.__init__() got an unexpected keyword argument 'executable_path'

Investigating shows that executable_path was deprecated in selenium 4 and finally removed in selenium 4.10.

So I constrained selenium to be <4.10 in setup.py and reinstalled.

Building the Simple Photo Gallery...
Generating thumbnails...
Generating the images_data.json file...
Starting Firefox webdriver...
Something went wrong while generating the images_data.json file:
Message: Service /Users/...lots_of_path_removed.../venv/lib/python3.10/site-packages/
simplegallery/bin/geckodriver unexpectedly exited. Status code was: 1

geckodriver.log shows:

error: Found argument '--websocket-port' which wasn't expected, or isn't valid in this context

SPG bundled geckodriver is 0.23.0

Updated to latest geckodriver (on mac) which was 0.34.0 at the time of this writing.

Building the Simple Photo Gallery...
Generating thumbnails...
Generating the images_data.json file...
Starting Firefox webdriver...
Loading album from https://photos.app.goo.gl/n7QTkXtNDihWJdqZ7...
Something went wrong while generating the images_data.json file:
'WebDriver' object has no attribute 'find_elements_by_xpath'

Investigating finds that find_elements_by_xpath was removed in selenium 4.3.0. So I constrained selenium further to be <4.3

Building the Simple Photo Gallery...
Generating thumbnails...
Generating the images_data.json file...
Starting Firefox webdriver...
Loading album from https://photos.app.goo.gl/n7QTkXtNDihWJdqZ7...
Finding photos...
Photos found: 3
...
(list of photos removed)
...
All photos processed!
The image descriptions are stored in images_data.json.
You can edit the file to add more descriptions and build the gallery again.
Creating the index.html...
The gallery was built successfully. Open public/index.html to view it.

BTW geckodriver 0.34 fixes another problem that i ran into while investigating this problem. geckodriver tries to use firefox-bin on mac which was broken in firefox 121. In geckodriver 0.34.0 they worked around this by using firefox binary instead (why are there two almost the same firefox binaries on mac?). So updating to geckodriver 0.34 actually fixes two problems.

kroesche commented 6 months ago

Short term fix can be to make the changes I listed above. However I think a proper long term fix is to remove geckodriver from this package and use webdriver-manager which I believe will handle all platforms and install the current version of geckodriver on demand.

kroesche commented 6 months ago

being worked on branch issue/135-webdriver-break

kroesche commented 4 months ago

Addressed in release 1.5.6