Selenium Documentation and Webdriver in Python

Spread the love

Selenium is a powerful tool for controlling web browsers using programing and performing browser automation. It’s serviceable 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.

Selenium Documentation Python

You can use selenium in three different ways easily.

Allow selenium to tap on buttons
Penetrate content in structures
Don’t forget to skim your site to check whether everything is “OK” and so on.

You can install using below code.

# for Windows
pip install selenium

# for Linux/Max
pip3 install selenium
# or
sudo -H pip3 install selenium

Selenium WebDriver Python

In the Python language, the selenium webdeiver is the parent of all methods and also classes that used in selenium Python. Now we are talking about Selenium WebDriver so, webDriver has various methods with many attributes and one of them can use to automate testing in Python selenium.

The webdriver says of selenium that allows us to perform various operations on multiple elements on a webpage. below we mentioned the code for knowing selenium webdriver in Python.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
driver.get("Paste here any website url")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

Leave a Comment