Lin*_*dau 5 python browser selenium python-3.x selenium-webdriver
我想为我打开的每个选项卡创建一个新会话,然后使用 Selenium python 单独控制会话。这可能吗?
@reynoldsnp:Firefox 有一个官方插件可以做到这一点,但我不确定你是否可以让 selenium 与该插件交互。addons.mozilla.org/en-GB/firefox/addon/multi-account-containers 如果您找到一种方法来做到这一点,我很想知道如何做。
(由于我的声誉评分,我还无法发表评论,因此引用评论)。
我不知道如何与扩展程序实际交互,但如果您有一组已知的网站,您想打开:
尝试这个:
制作一个 Firefox 配置文件以供与 Selenium 一起使用。多个配置文件
Windows 8/8.1/10:按键盘上的Win+ 。R类型
firefox --new-instance --ProfileManager
通过在设置向导中选择新的配置文件,在该配置文件中打开 Firefox。在该配置文件中安装扩展。
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)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1820 次 |
| 最近记录: |