如何在python中保存Firefox webdriver会话
为了保存chromedriver会话,我使用了以下代码片段:如何在python中保存Firefox webdriver会话,python,selenium,webdriver,Python,Selenium,Webdriver,为了保存chromedriver会话,我使用了以下代码片段: from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument('user-data-dir= path to where to save session') driver = webdriver.Chrome(executable_path='p
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument('user-data-dir= path to where to save session')
driver = webdriver.Chrome(executable_path='path to chromedriver.exe', chrome_options=options)
我试着用Firefox做同样的事情,但似乎不起作用:
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument('user-data-dir= path to where to save session')
driver = webdriver.Firefox(executable_path='path to geckodriver.exe', firefox_options=options)
这是正确的方法还是我错过了什么?下面是创建新配置文件并使用现有配置文件启动firefox的手动过程:
firefox.exe-CreateProfile-JoelUser
firefox.exe-CreateProfile“JoelUser c:\internet\joelusers moz profile”
firefox.exe-p“Joel User”
https://stackoverflow.com/a/54065166/6278432
参考资料:
你找到解决办法了吗?我也有同样的问题,搜索了很多,但没有找到答案,如果你分享一个解决方案,这将是一个很大的帮助