0% found this document useful (0 votes)
4 views1 page

Code 13 Dsasi

This document provides a step-by-step guide to install and explore Selenium with Python. It includes instructions for installing Python, pip, and Selenium, as well as a sample script to automate a Google search using Selenium. The final step is to run the provided Python script to test the setup.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Code 13 Dsasi

This document provides a step-by-step guide to install and explore Selenium with Python. It includes instructions for installing Python, pip, and Selenium, as well as a sample script to automate a Google search using Selenium. The final step is to run the provided Python script to test the setup.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Experiment 13

Step-by-Step: Install and Explore Selenium (Python)

✅ 1. Install Python

Download: https://www.python.org/downloads/

python --version

✅ 2. Install pip (Python Package Manager)

pip --version

✅ 3. Install Selenium

pip install selenium

4.Open your terminal (PowerShell or CMD) and run:

pip install selenium webdriver-manager

5.Replace your current test_google.py with this updated version:

from selenium import webdriver


from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
import time

# Proper Chrome driver setup


service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service)

# Open Google
driver.get("https://www.google.com")

# Search something
search_box = driver.find_element(By.NAME, "q")
search_box.send_keys("Selenium Python")
search_box.submit()

# Wait and close


time.sleep(10)
driver.quit()

6.✅ Now run:

python test_google.py

You might also like