【发布时间】:2022-01-08 06:38:37
【问题描述】:
我想为一个网站创建多个窗口,因此我需要为每个窗口创建新的身份。我认为私人模式对我来说是个不错的解决方案。 但是旧的方法并没有产生结果:
firefox_profile = webdriver.FirefoxProfile()
firefox_profile.set_preference("browser.privatebrowsing.autostart", True)
browser = webdriver.Firefox(firefox_profile=firefox_profile)
def main():
browser.switch_to.new_window('window')
browser.get("https://example.com")
我在码头找不到任何信息,所以也许你可以帮忙
【问题讨论】:
-
您能否就您的问题提供更多背景信息?这有助于避免XY problem。
-
我需要使用不同的用户名和密码循环打开新的浏览器窗口,每个窗口一个帐户。我现在的想法是使用私有模式,但不知道如何在新版本的 selenium 上使用它,因为旧方法不再有效
标签: python selenium firefox geckodriver firefox-profile