I'm trying to find how can I see if this button (image) it's already clicked or not:
But I haven't been able to do it and I need to interact with this button because it allows me to edit the price of some items and protect them if I don't wan't, the problem is that I need to check if it's clicked or not before doing it.
I have tried many times to identify when it's clicked or not, but I don't see any change on button attributes so I don't know how to do it. I also tried checking on price item and I see one change when it's clicked:
When it's editable, there is an attribute named "contenteditable" and it's value equals true, but when it's not editable this attribute dissapear and changes for a attribute named "disabled" equals true:
This are the lines of code that I have been using to get this attribute values:
cod = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="tbodyDatos"]/tr[1]/td[5]/div'))).get_attribute("disabled")
cod = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="tbodyDatos"]/tr[1]/td[5]/div'))).get_attribute("attributes[1]")
cod = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="tbodyDatos"]/tr[1]/td[5]/div'))).get_attribute("attributes[1].nodeValue")
I would appreciate it so much if anyone can help me.
¡Thanks!




fa-check-square-o, it's checked.