VOOZH about

URL: https://www.geeksforgeeks.org/python/python-automate-google-search-using-selenium/

⇱ Python | Automate Google Search using Selenium - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python | Automate Google Search using Selenium

Last Updated : 12 Jul, 2025
Google search can be automated using Python script in just 2 minutes. This can be done using selenium (a browser automation tool). Selenium is a portable framework for testing web applications. It can automatically perform the same interactions that any you need to perform manually and this is a small example of it. Mastering Selenium will help you automate your day to day tasks like controlling your tweets, Whatsapp texting and even just googling without actually opening a browser in just 15-30 lines of python code. The limits of automation is endless with selenium.

Installation

  1. Selenium
    pip install selenium 
    
  2. Chrome browser
  3. Chromedriver Download the chrome browser from here (choose the version for your system) After downloading, extract it and then copy the file in the folder of the script.
This can be done in two ways, by taking input from the user and by giving input in the command line itself. # Method 1 Asking the user for input. After saving the above script in script.py, run it in the command prompt as:
python script.py
# Method 2 Taking search string in the command line itself.
After saving the above script in script.py, run it in the command prompt as:
python script.py "geeksforgeeks"
Comment
Article Tags: