Skip to content

Commit

Permalink
Return driver object only when valid (#93)
Browse files Browse the repository at this point in the history
* Return driver object only when valid

Without this, a driver that failed the sanity check could be returned. This leads to attempting to use it when checking URLs, which led to avoidable failures.

Fixes #92
  • Loading branch information
mabraham authored Oct 10, 2024
1 parent d0e7560 commit 11dd54a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and **Merged pull requests**. Critical items to know are:
Referenced versions in headers are tagged on Github, in parentheses are for pypi.

## [vxx](https://github.com/urlstechie/urlschecker-python/tree/master) (master)
- avoid using web driver when it doesn't work (0.0.36)
- allow variable to skip checking certificates (0.0.35)
- switch back to pypi release of fake-useragent (0.0.34)
- preparing to install from git for fake-useragent (0.0.33)
Expand Down
3 changes: 2 additions & 1 deletion urlchecker/core/urlproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ def get_driver(self, port: Optional[int] = None, timeout: Optional[int] = 5):

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

# Do a sanity check of the driver
# Do a sanity check of the default driver
driver.check("https://google.com")
except:
driver = None
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
2 changes: 1 addition & 1 deletion urlchecker/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

__version__ = "0.0.35"
__version__ = "0.0.36"
AUTHOR = "Ayoub Malek, Vanessa Sochat"
AUTHOR_EMAIL = "[email protected], [email protected]"
NAME = "urlchecker"
Expand Down

0 comments on commit 11dd54a

Please sign in to comment.