Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. Through Selenium Python API you can access all functionalities of Selenium WebDriver in an intuitive way. This article illustrates about how to use Selenium Python to navigate to any link on web using get method of Selenium Webdriver in python.
If you have not installed Selenium and its components yet, install them from here – Selenium Python Introduction and Installation.
How to navigate links using Python Selenium
The first thing one’ll want to do with WebDriver is navigate to a link. The normal way to do this is by calling get method:
WebDriver will wait until the page has fully loaded (that is, the onload event has fired) before returning control to your test or script. It’s worth noting that if your page uses a lot of AJAX on load then WebDriver may not know when it has completely loaded. If you need to ensure such pages are fully loaded then you can use waits.
Project Example –
After you have installed Selenium, create a file called run.py as –
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python - Opening links using Selenium
- Count total number of Links In Webpage Using Selenium In Python
- How to get title of a webpage using Selenium in Python?
- How to get current_url using Selenium in Python?
- response.links - Python requests
- Selecting a drop-down list by using the Selenium.select_by_visible_text() method in Python
- Selenium Base Mini Project Using Python
- Python | SMS Bomber using Selenium
- Non blocking wait in selenium using Python
- Python | Automating Happy Birthday post on Facebook using Selenium
- How to access popup login window in selenium using Python
- Python | Automate Google Search using Selenium
- Flight-price checker using Python and Selenium
- How to take screenshot using Selenium in Python ?
- Search Google Using Python Selenium
- Writing Tests using Selenium Python
- How to move back and forward in History using Selenium Python ?
- Twitter Automation using Selenium Python
- Scraping COVID-19 statistics using Python and Selenium
- Gmail Login using Python Selenium
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.