Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from selenium.webdriver.common.by import By
- import time
- driver = webdriver.Chrome()
- driver.maximize_window()
- driver.get("https://omayo.blogspot.com/")
- # Finding the button element
- button = driver.find_element(By.ID, "but2")
- # Clicking the button
- button.click()
- # Changing the button color to green using JavaScript after clicking
- driver.execute_script("arguments[0].style.backgroundColor = 'green';", button)
- time.sleep(5) # Giving a brief pause to see the changes (not required, but good for demonstration)
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement