Skip to content

Commit

Permalink
Small ChromeDriver fix (#66)
Browse files Browse the repository at this point in the history
* fix dangling chrome

* small chromedriver fix
  • Loading branch information
michaelhball authored Nov 18, 2023
1 parent 12ce51c commit 4187c29
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions discogs_alert/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
import requests
from fake_useragent import UserAgent
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromiumService
from selenium.webdriver.chromium.options import ChromiumOptions
from selenium.webdriver.chromium.service import ChromiumService
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.os_manager import ChromeType

from discogs_alert import entities as da_entities, scrape as da_scrape

Expand Down Expand Up @@ -131,10 +130,10 @@ def get_driver_path(self):
try:
# to install both chromium binary and the matching chromedriver binary:
# apt-get install chromium-driver
return subprocess.check_output(['which', 'chromedriver']).decode().strip()
return subprocess.check_output(["which", "chromedriver"]).decode().strip()
except subprocess.CalledProcessError:
# will install latest chromedriver binary regardless of currently installed chromium version
return ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()
return ChromeDriverManager().install()

def get_marketplace_listings(self, release_id: int) -> da_entities.Listings:
"""Get list of listings currently for sale for particular release (by release's discogs ID)"""
Expand Down

0 comments on commit 4187c29

Please sign in to comment.