fix: prefer system chromedriver if available
This commit is contained in:
parent
c4e59e8c71
commit
c2b2727a86
1 changed files with 7 additions and 0 deletions
|
|
@ -52,6 +52,13 @@ impl ChromeDriverService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn ensure_chromedriver() -> Result<PathBuf> {
|
async fn ensure_chromedriver() -> Result<PathBuf> {
|
||||||
|
// First, check if system chromedriver is available
|
||||||
|
if let Ok(system_path) = which::which("chromedriver") {
|
||||||
|
info!("Using system chromedriver at {:?}", system_path);
|
||||||
|
return Ok(system_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fall back to downloading/caching chromedriver
|
||||||
let cache_dir = dirs::cache_dir()
|
let cache_dir = dirs::cache_dir()
|
||||||
.unwrap_or_else(|| PathBuf::from("/tmp"))
|
.unwrap_or_else(|| PathBuf::from("/tmp"))
|
||||||
.join("bottest")
|
.join("bottest")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue