为什么 ChromeDriver 不需要 Chrome 或 Chromium? [英] Why doesn't ChromeDriver require Chrome or Chromium?

查看:92
本文介绍了为什么 ChromeDriver 不需要 Chrome 或 Chromium?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ChromeDriver 在我的系统上运行,即使我没有安装 Chrome 或 Chromium.根据这个名字,我认为它就像一个汽车司机",你仍然需要一辆车才能开车.或者可能就像产品的 API 一样,您仍然需要该产品来调用 API 来完成某些事情.

哎呀,毕竟安装了 Chromium.

解决方案

当然 ChromeDriver 需要 ChromeChromium.

根据

1对于 Linux 系统,ChromeDriver 期望 /usr/bin/google-chrome 是实际的符号链接Chrome 二进制文件.

您还可以通过设置特殊功能来强制 ChromeDriver 使用自定义位置.您可以在 在非标准位置使用 Chrome 可执行文件

ChromeDriver is working on my system even though I don't have Chrome or Chromium installed. Based on the name, I thought it was like a "car driver" where you still need a car to get going. Or maybe like a product's API where you still need the product for your API calls to accomplish something.

Edit: Whoops, Chromium is installed after all.

解决方案

Of course ChromeDriver requires Chrome or Chromium.

As per ChromeDriver - WebDriver for Chrome ChromeDriver is a separate executable that WebDriver uses to control Chrome.

Now, as per Requirements - ChromeDriver the server expects you to have Chrome installed in the default location for each system as follows:

1For Linux systems, the ChromeDriver expects /usr/bin/google-chrome to be a symlink to the actual Chrome binary.

You can also force ChromeDriver to use a custom location by setting a special capability. You can find the documentation in Using a Chrome executable in a non-standard location

这篇关于为什么 ChromeDriver 不需要 Chrome 或 Chromium?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆