Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return driver object only when valid #93

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions urlchecker/core/urlproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,11 @@ def get_driver(self, port: Optional[int] = None, timeout: Optional[int] = 5):
try:
from .webdriver import WebDriver

driver = WebDriver(port=port, timeout=timeout)
default_driver = WebDriver(port=port, timeout=timeout)

# Do a sanity check of the driver
driver.check("https://google.com")
# Do a sanity check of the default driver
default_driver.check("https://google.com")
driver = default_driver
except:
logger.warning(
"Issue with driver, results will be improved if you have it! Please match your version from https://googlechromelabs.github.io/chrome-for-testing"
Expand Down
Loading