Skip to content

Fix Selenium 4 compatibility issues#61

Open
aserper wants to merge 1 commit intoinAudible-NG:masterfrom
aserper:fix-selenium-4-compatibility
Open

Fix Selenium 4 compatibility issues#61
aserper wants to merge 1 commit intoinAudible-NG:masterfrom
aserper:fix-selenium-4-compatibility

Conversation

@aserper
Copy link

@aserper aserper commented Sep 16, 2025

Summary

  • Updated code to be compatible with Selenium 4.x
  • Fixed deprecated WebDriver initialization methods
  • Improved error handling and debug mode functionality

Changes Made

  • Updated WebDriver initialization to use Service class (required for Selenium 4+)
  • Replaced deprecated find_element_by_id with find_element(By.ID, ...)
  • Added explicit waits using WebDriverWait for better element detection
  • Fixed debug mode to show browser window by conditionally applying headless flag
  • Added better error handling with informative messages for troubleshooting
  • Updated requirements.txt to specify minimum Selenium version 4.0.0

Problem Solved

This PR fixes the following errors encountered when running with modern Selenium versions:

  • TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'
  • NoSuchElementException when trying to locate login form elements

Test Plan

  • Tested with Selenium 4.x installation
  • Verified normal mode execution works
  • Verified debug mode (-d flag) shows browser window
  • Successfully retrieved activation bytes after authentication

- Update WebDriver initialization to use Service class (Selenium 4+ requirement)
- Replace deprecated find_element_by_id with find_element(By.ID, ...)
- Add explicit waits for element presence to improve reliability
- Fix debug mode to show browser window by conditionally adding headless flag
- Add better error handling with informative messages
- Update requirements.txt to specify Selenium 4.0.0 minimum version

These changes resolve TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'
and NoSuchElementException errors when running with modern Selenium versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant