【发布时间】:2021-11-06 07:30:10
【问题描述】:
使用 Selenium 和 Python,我们如何等待 id 为 foo 的某个元素拥有 backgroundColor 的 "rgb(1, 2, 3)"?
到目前为止,我认为应该是这样的
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
expected_backgroundColor = EC.some_method((By.ID, "foo"))
WebDriverWait(self.driver, 15).until(expected_backgroundColor)
但不确定使用哪个EC 方法。
任何建议都会有所帮助!谢谢!
【问题讨论】:
标签: python python-3.x selenium selenium-webdriver selenium-chromedriver