Open mabraham opened 5 hours ago
Yes you are totally right, the driver should be set to None to avoid the error. This is being done in https://github.com/urlstechie/urlchecker-python/blob/d0e7560e3bacf9d7e85bfec7171f3a7d17d9bcaa/urlchecker/core/urlproc.py#L152
When the exception is raised the returned value should be none unless line 156 changes the driver value, which means you do have a driver but it doesn't pass the sanity check. @vsoch might have a better explanation for this.
Also can you provide a bit more information on your setup please?
A simple fix is to replace the return statement with two different ones; one under try and one under except.
When it crashes like that, it's a mismatch between the chrome you have and the driver.
Thanks for the prompt replies!
This was running in a Docker container based on ubuntu 24.04, customized for building and linting some static HTML pages. There is no browser or similar, except as might have been brought in by pipx install urlchecker
. So I don't know what kind of driver urlchecker might have found :-(
A simple fix is to replace the return statement with two different ones; one under try and one under except.
Yes, or to replace the driver by None if an exception was caught.
In a CI container where I have not installed a browser or web driver, I am trying to run urlchecker, but get an error message like
That makes it look like a driver is actually required.
If a driver is intended to be optional, then I think https://github.com/urlstechie/urlchecker-python/blob/master/urlchecker/core/urlproc.py#L161 should set
driver = None
so that https://github.com/urlstechie/urlchecker-python/blob/master/urlchecker/core/urlproc.py#L282 will not choke on an invalid driver.