【发布时间】:2021-04-17 03:23:26
【问题描述】:
是否可以在服务器中打开具有特定远程配置文件(非临时)的 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?_)
)
【问题讨论】:
-
是的,你可以。您是否尝试过禁用服务器中的防火墙?
-
@Prabhakar 防火墙正在将端口转发到服务器。也许我的问题并不清楚。我已经编辑过了。
-
您是否在您的机器中创建了 FireFox 配置文件?如果没有,请参考toolsqa.com/selenium-webdriver/custom-firefox-profile 并将配置文件添加到您的代码中,然后尝试
-
我可以将配置文件从我的机器传递到服务器并在服务器in中创建临时配置文件。但我想使用 of 服务器的配置文件。
标签: python selenium remotewebdriver