Skip to content

Commit 6e30df1

Browse files
committed
Refactor chromedriver setup and WebDriverWait in capture_page function for improved readability
1 parent b7805f6 commit 6e30df1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/modules/apps/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def capture_page(url: str, output_file: str = "screenshot.png"):
5353

5454
# Set up Chrome service with explicit path to chromedriver and logging
5555
service = Service(
56-
executable_path='/usr/local/bin/chromedriver',
56+
# executable_path='/usr/local/bin/chromedriver',
5757
log_output=PIPE, # Redirect logs to pipe
5858
service_args=['--verbose'] # Enable verbose logging
5959
)
@@ -78,9 +78,9 @@ def capture_page(url: str, output_file: str = "screenshot.png"):
7878
# Additional wait for dynamic content
7979
from selenium.webdriver.support.ui import WebDriverWait
8080
from selenium.webdriver.support import expected_conditions as EC
81-
WebDriverWait(driver, 10).until(
82-
lambda d: d.execute_script('return document.readyState') == 'complete'
83-
)
81+
# WebDriverWait(driver, 10).until(
82+
# lambda d: d.execute_script('return document.readyState') == 'complete'
83+
# )
8484

8585
print("Taking screenshot...")
8686
driver.save_screenshot(output_file)

0 commit comments

Comments
 (0)