Skip to content

Commit

Permalink
Ensure chromedriver version matches browser version
Browse files Browse the repository at this point in the history
Fixes #172.

There was an issue with using `driver_version="browser"` in undetected
Chrome mode in SeleniumBase 4.20.0. SeleniumBase 4.20.1 fixes that.
Additionally, the Docker image no longer needs to explicitly download
the Chromedriver (there is no option to do `sbase get chromedriver
browser` yet). Instead, it will download the driver the first time
SeleniumBase initializes the driver.
  • Loading branch information
jdholtz committed Oct 12, 2023
1 parent 8bcdf30 commit ca56bc6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ If there is no "Upgrading" header for that version, no post-upgrade actions need
- A new [FAQ question](README.md#faq) was added to help users that run into issues starting the webdriver in Docker
- If you find a better solution to this issue, please let me know

### Improvements
- Ensure the chromedriver version always matches the downloaded browser version
([#172](https://github.com/jdholtz/auto-southwest-check-in/issues/172))

### Upgrading
- Upgrade the dependencies to the latest versions by running `pip install -r requirements.txt`
- If you are using Python 3.7, the script still works. However, it is officially unsupported and therefore recommended to upgrade
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ RUN apk add --update --no-cache chromium gcompat
COPY requirements.txt requirements.txt
RUN pip3 install --upgrade pip && pip3 install --no-cache-dir -r requirements.txt

# For some reason, downloading uc_driver results in being detected. Although the chromedriver
# will be automatically downloaded at runtime, it is downloaded now to make sure no version
# discrepancy happens.
RUN sbase get chromedriver

COPY . .

ENTRYPOINT ["python3", "-u", "southwest.py"]
1 change: 1 addition & 0 deletions lib/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def _get_driver(self) -> Driver:
browser_path = self.checkin_scheduler.reservation_monitor.config.browser_path
driver = Driver(
binary_location=browser_path,
driver_version="browser", # Always ensure the browser and driver versions match
headless=True,
uc_cdp_events=True,
undetectable=True,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apprise==1.5.0
certifi==2023.07.22
pytz==2023.3.post1 # Remove when this script only supports Python 3.9+
requests==2.31.0
seleniumbase==4.20.0
seleniumbase==4.20.1

0 comments on commit ca56bc6

Please sign in to comment.