from selenium.webdriver import Firefox from selenium.webdriver.common.by import By # Create a Firefox browser instance browser = Firefox() # Find an element by ID and get its attribute value element = browser.find_element(By.ID, 'my-id') print(element.get_attribute('class')) # Find an element by CSS selector and click it element = browser.find_element(By.CSS_SELECTOR, '.my-class') element.click() # Find an element by XPATH and get its text element = browser.find_element(By.XPATH, '//div[@id="my-div"]/span') print(element.text)In these examples, we use the `find_element` method to locate elements on the page using various selection methods such as `By.ID`, `By.CSS_SELECTOR`, and `By.XPATH`. We then perform actions on the element, such as getting an attribute value or clicking the element. To use this module, you need to install the Selenium package using `pip`.