Selenium is a powerful tool for controlling web browsers through programs and performing browser automation. It is functional for all browsers, works on all major OS and its scripts are written in various languages i.e Python, Java, C#, etc, we will be working with Python.
In this article, we will learn how to know whether the text is on a web page or not using selenium in python.
- First, we will open the chrome driver using the Chrome() method in the Selenium web driver
- Assign the Web URL.
- Then the driver will open the Give Web URL
- Get Web Page Source Code using page_source property.
- Assign the text to be searched.
- After getting the web page text, we will search whether the text is present or not.
Below is the implementation:
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. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course