MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / get_driver_url

Method get_driver_url

rust/src/chrome.rs:361–404  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

359 }
360
361 fn get_driver_url(&mut self) -> Result<String, Error> {
362 let major_driver_version = self
363 .get_major_driver_version()
364 .parse::<i32>()
365 .unwrap_or_default();
366
367 if major_driver_version >= MIN_CHROMEDRIVER_VERSION_CFT && self.driver_url.is_none() {
368 // This case happens when driver_version is set (e.g. using CLI flag)
369 self.request_good_driver_version_from_online()?;
370 }
371
372 // As of Chrome 115+, the driver URL is already gathered thanks to the CfT endpoints
373 if self.driver_url.is_some() {
374 return Ok(self.driver_url.as_ref().unwrap().to_string());
375 }
376
377 let driver_version = self.get_driver_version();
378 let os = self.get_os();
379 let arch = self.get_arch();
380 let driver_label = if WINDOWS.is(os) {
381 "win32"
382 } else if MACOS.is(os) {
383 if ARM64.is(arch) {
384 // As of chromedriver 106, the naming convention for macOS ARM64 releases changed. See:
385 // https://groups.google.com/g/chromedriver-users/c/JRuQzH3qr2c
386 if major_driver_version < 106 {
387 "mac64_m1"
388 } else {
389 "mac_arm64"
390 }
391 } else {
392 "mac64"
393 }
394 } else {
395 "linux64"
396 };
397 Ok(format!(
398 "{}{}/{}_{}.zip",
399 self.get_driver_mirror_url_or_default(DRIVER_URL),
400 driver_version,
401 self.driver_name,
402 driver_label
403 ))
404 }
405
406 fn get_driver_path_in_cache(&self) -> Result<PathBuf, Error> {
407 Ok(compose_driver_path_in_cache(

Callers

nothing calls this directly

Calls 6

get_driver_versionMethod · 0.80
get_osMethod · 0.80
get_archMethod · 0.80
isMethod · 0.65

Tested by

no test coverage detected