带有远程配置文件的Selenium Remote Webdriver

Nun*_*dré 6 python selenium remotewebdriver

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

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

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?_)
        )
Run Code Online (Sandbox Code Playgroud)

fal*_*der 3

不,在远程 Webdriver 的情况下无法传递远程配置文件的路径。原因是所有远程通信都是由命令执行器处理的。浏览器配置文件仅处理本地文件系统。虽然可以在服务器上配置默认配置文件。