Skip to content

Commit 11dd54a

Browse files
authored
Return driver object only when valid (#93)
* 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
1 parent d0e7560 commit 11dd54a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and **Merged pull requests**. Critical items to know are:
1212
Referenced versions in headers are tagged on Github, in parentheses are for pypi.
1313

1414
## [vxx](https://github.com/urlstechie/urlschecker-python/tree/master) (master)
15+
- avoid using web driver when it doesn't work (0.0.36)
1516
- allow variable to skip checking certificates (0.0.35)
1617
- switch back to pypi release of fake-useragent (0.0.34)
1718
- preparing to install from git for fake-useragent (0.0.33)

urlchecker/core/urlproc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ def get_driver(self, port: Optional[int] = None, timeout: Optional[int] = 5):
155155

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

158-
# Do a sanity check of the driver
158+
# Do a sanity check of the default driver
159159
driver.check("https://google.com")
160160
except:
161+
driver = None
161162
logger.warning(
162163
"Issue with driver, results will be improved if you have it! Please match your version from https://googlechromelabs.github.io/chrome-for-testing"
163164
)

urlchecker/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
"""
99

10-
__version__ = "0.0.35"
10+
__version__ = "0.0.36"
1111
AUTHOR = "Ayoub Malek, Vanessa Sochat"
1212
AUTHOR_EMAIL = "superkogito@gmail.com, vsochat@stanford.edu"
1313
NAME = "urlchecker"

0 commit comments

Comments
 (0)