有人知道如何将现有的Firefox浏览器与Selenium连接起来吗?我试着用Chrome的方式-没有运气
以调试模式启动Firefox:
start firefox.exe --marionette -foreground -no-remote -profile C:\FirefoxTEMP
我用Python编写的代码:
from selenium import webdriver
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_experimental_option("debuggerAddress", "127.0.0.1:9224")
drivePath = r'C:\\geckodriver.exe'
driver = webdriver.Firefox(options= options, executable_path = drivePath)
我想这是启动调试模式的问题。在Chrome上,我可以通过命令和端口来实现:
chrome.exe --remote-debugging-port=9223 --user-data-dir="C:\selenum\ChromeProfile"
更新。在调试模式下打开Firefox的更好方法(默认为端口6000):
相关问题 更多 >
编程相关推荐