Skip to content

Commit

Permalink
Try to use Github Actions' chromedriver
Browse files Browse the repository at this point in the history
  • Loading branch information
stucka committed Dec 24, 2024
1 parent 9e7f224 commit 35b3d14
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions warn/scrapers/va.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ def scrape(
chromeoptionsholder.add_argument("--remote-debugging-pipe")
chromeoptionsholder.add_argument("--verbose")

chrome_install = ChromeDriverManager().install()

# Weird error with finding the driver name in Windows. Sometimes.
if chrome_install.endswith("THIRD_PARTY_NOTICES.chromedriver"):
chrome_install = chrome_install.replace(
"THIRD_PARTY_NOTICES.chromedriver", "chromedriver.exe"
)
if "CHROMEWEBDRIVER" in os.environ:
chrome_install = os.environ["CHROMEWEBDRIVER"]
else:
chrome_install = ChromeDriverManager().install()

# Weird error with finding the driver name in Windows. Sometimes.
if chrome_install.endswith("THIRD_PARTY_NOTICES.chromedriver"):
chrome_install = chrome_install.replace(
"THIRD_PARTY_NOTICES.chromedriver", "chromedriver.exe"
)
logger.debug(f"Chrome install variable is {chrome_install}")
# folder = os.path.dirname(chrome_install)
# chromedriver_path = folder # os.path.join(folder, "chromedriver.exe")
# service = ChromeService(chromedriver_path)
service = ChromeService(chrome_install)
driver = webdriver.Chrome(options=chromeoptionsholder, service=service)
logger.debug(f"Attempting to fetch {csv_url}")
Expand Down

0 comments on commit 35b3d14

Please sign in to comment.