1

When I run chrome driver from selenium the browser opens in minimized windows. but I want it to open by default as maximized

2 Answers 2

2

The following code was taken from this link. https://pythonbasics.org/selenium-maximize/

from selenium import webdriver 
import time

driver = webdriver.Firefox()
driver.maximize_window()
time.sleep(5)

driver.get("https://www.python.org")

This is one of the methods to do so.

Sign up to request clarification or add additional context in comments.

Comments

1

You can either use driver.maximize_window() or chrome_options.add_argument("--start-maximized") which will maximize the browser when ever it opens.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.