try putting chrome and chromedriver in the same dir
Some checks failed
ChromeTests / build (3.12) (push) Failing after 54s
EdgeTests / build (3.12) (push) Successful in 54s
Pylint / build (3.12) (push) Successful in 10s

This commit is contained in:
Greg Gauthier 2024-07-24 10:40:41 +01:00
parent b1081bb5b0
commit 74af52c464
4 changed files with 5 additions and 7 deletions

View File

@ -40,15 +40,15 @@ jobs:
wget https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip wget https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip
unzip chrome-linux64.zip unzip chrome-linux64.zip
unzip chromedriver_linux64.zip unzip chromedriver_linux64.zip
mv chromedriver drivers mv chromedriver chrome-linux64
- name: Verify Installation - name: Verify Installation
run: | run: |
pwd pwd
echo ${{gitea.workspace}} echo ${{gitea.workspace}}
export PATH=$PATH:${{gitea.workspace}}/chrome-linux64 export PATH=$PATH:${{gitea.workspace}}/chrome-linux64
export PATH=$PATH:${{gitea.workspace}}/drivers
which chrome which chrome
which chromedriver
chrome --version chrome --version
chromedriver --version chromedriver --version

3
.gitignore vendored
View File

@ -7,4 +7,5 @@
.idea/ .idea/
.vscode/ .vscode/
.venv/ .venv/
drivers/ drivers/
chrome-linux64/

View File

@ -26,7 +26,7 @@ class BrowserDriver:
def chrome(headless=True): def chrome(headless=True):
chrome_path = os.path.join(CWD, 'chrome-linux64', 'chrome') chrome_path = os.path.join(CWD, 'chrome-linux64', 'chrome')
driver_path = os.path.join(CWD, 'drivers', 'chromedriver') driver_path = os.path.join(CWD, 'chrome-linux64', 'chromedriver')
options = ChromeOptions() options = ChromeOptions()
options.binary_location = chrome_path options.binary_location = chrome_path
if headless: if headless:
@ -50,9 +50,6 @@ def edge(headless=True):
if platform.system() == 'Windows': if platform.system() == 'Windows':
driver_name += ".exe" driver_name += ".exe"
edgedriver_loc = os.path.join(CWD, 'drivers', driver_name) edgedriver_loc = os.path.join(CWD, 'drivers', driver_name)
print("***** DRIVER DEFINED LOCATION *****")
print(edgedriver_loc)
if os.path.isfile(edgedriver_loc): if os.path.isfile(edgedriver_loc):
print(f'\nThe file {edgedriver_loc} exists.\n') print(f'\nThe file {edgedriver_loc} exists.\n')
else: else:

Binary file not shown.