如何使用Selenium 3.4.3启动firefox(不是firefoxbin),

2024-09-28 12:12:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我想在mac OSX 10.12.2上使用selenium 3.4.3启动firefox进程(而不是firefox bin)。我有GeckoDriver版本0.18.0和firefox版本55.0

默认情况下,它通过selenium启动firefoxbin。我想将进程改为“firefox”,而不是“firefox bin”。我试着在firefox中改变路径_二进制.py在站点包的selenium文件夹中。但没有成功,它还是推出了firefox bin。你知道吗

Python版本是2.7


Tags: py路径版本文件夹bin进程站点mac
1条回答
网友
1楼 · 发布于 2024-09-28 12:12:56

在生成驱动程序时指定firefox可执行文件。你知道吗

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

// replace the path to path of your firefox process, please use absolute path
// and make your account has the execution right on the firefox process
binary = FirefoxBinary('F:\FirefoxPortable\Firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary)

相关问题 更多 >

    热门问题