Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
327 views
in Technique[技术] by (71.8m points)

python - 如何使用Selenium Python最小化您的Chrome浏览器?(How To Minimize Your Chrome Browser With Selenium Python?)

I Want To Know How to Minimize My Chrome Window in selenium

(我想知道如何最小化硒中的Chrome窗口)

I Don't Want How To Maximize Because I Know how to maximize chrome window!

(我不想最大化,因为我知道如何最大化镀铬窗口!)

Here is my code:

(这是我的代码:)

options = webdriver.ChromeOptions()

options.add_argument('--disable-extensions')

options.add_argument('--profile-directory=Default')

options.add_argument("--incognito")

options.add_argument("--disable-plugins-discovery");

options.add_argument("--start-maximized")

driver = webdriver.Chrome(options=options)

driver.get('website.com')
driver.delete_all_cookies()
  ask by Usman Shahzad translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It should works with:

(它应该与:)

driver.minimize_window()

(driver.minimize_window())

Invokes the window manager-specific 'minimize' operation

(调用特定于窗口管理器的“最小化”操作)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...