How to make Firefox open all links opened via WebDriver in the same window?

后端 未结 6 1587
礼貌的吻别
礼貌的吻别 2021-01-04 10:23

I want to open all links in the same window instead in new window. I tried

profile.setPreference(\"browser.link.open_newwindow\", 1)

but th

6条回答
  •  悲&欢浪女
    2021-01-04 11:12

    In the selenium config file:

    C:\Python27\Lib\site-packages\selenium\webdriver\firefox\webdriver_prefs.json

    change the following line from:

    "browser.link.open_newwindow": 2,
    

    to:

    "browser.link.open_newwindow": 3,
    

    I test it and it worked

提交回复
热议问题