How to bring selenium browser to the front?

后端 未结 6 675
旧时难觅i
旧时难觅i 2021-02-08 06:24

if the browser window is in bg, then this line doesn\'t work.

from selenium import webdriver

from selenium.webdriver.common.keys import Keys
from selenium.webd         


        
6条回答
  •  悲哀的现实
    2021-02-08 07:03

    To answer your original question, you need to use the maximize window method for the browser to regain focus and be placed in foreground. it should be something like this in Python:

    browser.maximize_window()
    

提交回复
热议问题