Selenium is a powerful tool to programmatically manipulate an internet browser. It supports all major browsers, runs on all major operating systems, and has scripts written in many different languages, including Python, Java, C#, and others.
An interface called Selenium WebDriver enables us to run tests on browsers. It enables us to write test scripts in the programming language of our choice.
Note: Before installing the selenium web bindings, run the following command to ensure that Python has been installed.
To install the selenium web bindings using
pip, run the following command:
pip install selenium
refresh() method is used to refresh the currrent page in selenium.
Let’s look at the code below:
from selenium import webdriver driver = webdriver.Firefox(executable_path="path to the driver") driver.get("https://educative.io/") driver.refresh() driver.close()
Firefox()method. The path to the driver is specified. The driver can be downloaded from here.
View all Courses