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

Method get_driver_url

rust/src/firefox.rs:318–358  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

316 }
317
318 fn get_driver_url(&mut self) -> Result<String, Error> {
319 let driver_version = self.get_driver_version();
320 let os = self.get_os();
321 let arch = self.get_arch();
322
323 // As of 0.32.0, geckodriver ships aarch64 binaries for Linux and Windows
324 // https://github.com/mozilla/geckodriver/releases/tag/v0.32.0
325 let minor_driver_version = self
326 .get_minor_version(driver_version)?
327 .parse::<i32>()
328 .unwrap_or_default();
329 let driver_label = if WINDOWS.is(os) {
330 if X32.is(arch) {
331 "win32.zip"
332 } else if ARM64.is(arch) && minor_driver_version > 31 {
333 "win-aarch64.zip"
334 } else {
335 "win64.zip"
336 }
337 } else if MACOS.is(os) {
338 if ARM64.is(arch) {
339 "macos-aarch64.tar.gz"
340 } else {
341 "macos.tar.gz"
342 }
343 } else if X32.is(arch) {
344 "linux32.tar.gz"
345 } else if ARM64.is(arch) && minor_driver_version > 31 {
346 "linux-aarch64.tar.gz"
347 } else {
348 "linux64.tar.gz"
349 };
350 Ok(format!(
351 "{}download/v{}/{}-v{}-{}",
352 self.get_driver_mirror_url_or_default(DRIVER_URL),
353 driver_version,
354 self.driver_name,
355 driver_version,
356 driver_label
357 ))
358 }
359
360 fn get_driver_path_in_cache(&self) -> Result<PathBuf, Error> {
361 Ok(compose_driver_path_in_cache(

Callers 1

test_driver_urlFunction · 0.45

Calls 5

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

Tested by 1

test_driver_urlFunction · 0.36