我想为我打开的每个选项卡创建一个新 session ,然后使用 Selenium python 单独控制 session 。这可能吗?
最佳答案
@reynoldsnp: Firefox has an official addon that does this, but I'm not sure if you can get selenium to interact with the addon. addons.mozilla.org/en-GB/firefox/addon/multi-account-containers If you figure out a way to do it, I would love to know how.
(由于我的声誉评分,我还不能发表评论,因此引用了评论)。
我不知道如何与扩展程序进行实际交互,但如果您有一组已知的站点,您想打开:
尝试这个:
Windows 8/8.1/10: Press Win + R on your keyboard. Type
firefox --new-instance --ProfileManager
确保选中该复选框。
from selenium import webdriver
profile = webdriver.FirefoxProfile('path/to/your/profile') # on windows found here: %APPDATA%/Mozilla/Firefox/Profiles
driver = webdriver.Firefox(firefox_profile=profile)
关于python - 使用 Selenium Web 驱动程序为每个选项卡进行一个 session ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63207605/