是否可以在服务器中打开具有特定远程配置文件(非临时配置文件)的 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/