How to open a browser window, maximize it and open a website using selenium
How to open a browser window, maximize it and open a website using selenium?
We will be using Google Chrome for our example below.
First we need to import the webdriver from selenium using the code:
You can create an instance of your web browser and using the instance we will be performing the actions related to the browser window.
You can give any name to the browser instance. In the below example, myBrowser is the browser instance.
Using the myBrowser instance, we will open a new chrome window and open a website.
The browser window will never open in a fully maximized state. To maximize the window, we use the maximize_window() function as shown below.
Overall our code will look like :
© Copyright - 2018 - 2023 | All rights reserved at Funda of Web IT