Hello I am using python selenium to get some css propertiew of a button. I need also the hover background color. The css is like this:
.overview .add-to-cart-button:hover, .variant-overview .add-to-cart-button:hover {
background-color: #b41733;}
My code is this:
from selenium import webdriver
from selenium.webdriver.support.color import Color
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome(executable_path = ChromeDriverManager().install())
driver.get('https://www.inshoes.gr/andrikes-zones-andrikes-zones-dermatines-diplis-opseos-33000481-kamel-mavro')
background_color = driver.find_element_by_id('addtocartbutton-7531').value_of_css_property('background-color')
text_color = driver.find_element_by_id('addtocartbutton-7531').value_of_css_property('color')
hex_color = Color.from_string(background_color).hex
hex_text_color = Color.from_string(text_color).hex
print(hex_color)
print(hex_text_color)
Can someone help me?