python - 具有远程配置文件的 Selenium Remote Webdriver

标签 python selenium remotewebdriver

是否可以在服务器中打开具有特定远程配置文件(非临时配置文件)的 Selenium Remote Webdriver?

我只能从客户端传递一个 browser_profile。如果我在没有 browser_profile 的情况下实例化类,Selenium 会在服务器中创建一个新的临时配置文件。

from selenium import webdriver

class Remote(webdriver.Remote):
    def __init__(self, **kwargs):
        capabilities = {_**whatever_}

        super().__init__(
            command_executor='http://HOST:PORT/wd/hub',
            desired_capabilities=capabilities.copy(),
            browser_profile=webdriver.FirefoxProfile(_what?_)
        )

最佳答案

不,在远程 webdriver 的情况下,不可能传递远程配置文件的路径。原因是所有远程通信都由 command executor 处理.在哪里 browser profile仅处理本地文件系统。虽然默认配置文件可以是 configured在服务器上。

关于python - 具有远程配置文件的 Selenium Remote Webdriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40291904/

相关文章:

java.lang.NoSuchMethodError : org. openqa.selenium.support.ui.Wait.until(Lcom/google/common/base/Function;)使用selenium-server-standalone-3.12.0

java - Selenium moveToElement() 不起作用

java - Selenium Grid并行测试时如何让hub决定执行哪个节点?

selenium - 通过 sendKeys() 将字符串发送到 ExtJS 输入时,第一个字符不断丢失

selenium - UnreachableBrowserException : Could not start a new session. 可能的原因是使用 Selenium Grid 的远程服务器的地址无效

Python:内存高效排序的元组列表由两个元素

python - Python 是否缓存导入的文件?

python - 使用通用基类修复多重继承

python - 如何在Pygame中截取屏幕的特定部分

c# - Selenium 方法 WaitUntilTextToBePresentInElement 失败