from selenium import webdriver from selenium.webdriver.common.by import By # Very important to import this my_variable = driver.find_element(by=By.CLASS_NAME, value="name_of_my_class")