Hi Suhana, you can use CSS Selectors like class, id, label, link etc to select elements in Python Selenium Webdriver. Following code snippet shows how to use them:
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from time import sleep
from selenium.common.exceptions import NoSuchElementException
from pip._vendor.distlib import resources
driver = webdriver.Firefox()
driver.get("https://www.edureka.co/")
sleep(20)
try:
driver.find_element_by_css_selector("li.login").click()
except NoSuchElementException:
print("Element not found")
sleep(5)
driver.quit()