Skip to content

Commit f62eaab

Browse files
authored
Fixed Chrome Options 🔧
Enabled some flags to fix issues with this action.
1 parent 9bc9795 commit f62eaab

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Selenium-Template.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
# and if it doesn't exist, download it automatically,
1111
# then add chromedriver to path
1212

13-
chrome_options = webdriver.ChromeOptions()
14-
# Add your options as needed
13+
chrome_options = webdriver.ChromeOptions()
14+
# Add your options as needed
1515
options = [
16-
# Define window size here
17-
"--window-size=1200,1200",
16+
# Define window size here
17+
"--window-size=1200,1200",
1818
"--ignore-certificate-errors"
1919

2020
#"--headless",
21-
#"--disable-gpu",
2221
#"--window-size=1920,1200",
2322
#"--ignore-certificate-errors",
2423
#"--disable-extensions",
25-
#"--no-sandbox",
26-
#"--disable-dev-shm-usage",
27-
#'--remote-debugging-port=9222'
24+
# These flags BELOW are recommended for stability when running Chrome in headless or containerized environments (such as GitHub Actions).
25+
"--disable-gpu",
26+
"--no-sandbox",
27+
"--disable-dev-shm-usage",
28+
'--remote-debugging-port=9222'
2829
]
29-
3030
for option in options:
3131
chrome_options.add_argument(option)
3232

@@ -37,4 +37,3 @@
3737
print(driver.title)
3838
with open('./GitHub_Action_Results.txt', 'w') as f:
3939
f.write(f"This was written with a GitHub action {driver.title}")
40-

0 commit comments

Comments
 (0)