简单的问题:
这两个陈述之间的确切区别是什么:
WebDriverWait(self._driver, WEB_WAIT_TIMEOUT).until(ec.invisibility_of_element_located(element))
和
WebDriverWait(self._driver, WEB_WAIT_TIMEOUT).until_not(ec.presence_of_element_located(element))
在这两种情况下,硒的行为在我的情况下是相同的。提前致谢
感谢您的回复 好的,但仍有一些我不明白的地方:我有检查微调器是否不可见的基本功能。
`def wait_until_request_api_process_finished(self):
try:
WebDriverWait(self._driver, 1).until(ec.visibility_of_element_located(BaseLoc.spinner))
WebDriverWait(self._driver, 10).until(ec.invisibility_of_element_located(BaseLoc.spinner))
except TimeoutException:
pass
但是,即使微调器不可见,selenium 也会等待(比预期多 8 秒)。有什么问题?