Text Searching in Google using Selenium in Python
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 are going to see how to automate our browser. We can just select the word/sentence and speak Search and the word/sentence gets automatically searched and provide you with accurate results.
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
- pyautogui: PyAutoGUI is a cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
- selenium : Selenium is a powerful tool for controlling web browsers through programs and performing browser automation.
- speech_recognition: Speech Recognition is an important feature in several applications used such as home automation, artificial intelligence, etc.
- We are using chromedriver_autoinstaller so that then we could see the meaning of the searched word. [Have Installed Chrome Latest Version In your local device).
Step 1: Import required modules
Step 2: Let’s invoke the speech recognition module and initiate our internal speaker so that it could hear our voice as the input and could initiate the process. MyText stores our voice command as a text.
Step 3: After selecting and speaking search using your voice will now initiate the process. Using selenium and pyautogui automatically takes that word and gives the appropriate search result.
Below is the full implementation: