当前位置: 首页 > 知识库问答 >
问题:

如何在Python中HibernateSelenium WebDriver毫秒

孙明德
2023-03-14

我正在脚本中使用time库:

import time
time.sleep(1)

它可以让我的Selenium WebDriverHibernate一秒,但怎么可能是250毫秒呢?

共有1个答案

蒋泰
2023-03-14
import time
time.sleep(1) #sleep for 1 sec
time.sleep(0.25) #sleep for 250 milliseconds
class selenium.webdriver.support.expected_conditions.presence_of_element_located(locator)

Parameter : locator - used to find the element returns the WebElement once it is located

Description : An expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible or interactable (i.e. clickable). 
class selenium.webdriver.support.expected_conditions.visibility_of_element_located(locator)

Parameter : locator -  used to find the element returns the WebElement once it is located and visible

Description : An expectation for checking that an element is present on the DOM of a page and visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0.
class selenium.webdriver.support.expected_conditions.element_to_be_clickable(locator)

Parameter : locator - used to find the element returns the WebElement once it is visible, enabled and interactable (i.e. clickable).

Description : An Expectation for checking an element is visible, enabled and interactable such that you can click it. 
 类似资料:
  • 问题内容: 我可以通过java.util.Date(milliseconds)在Java中创建类似的Date对象。如何在Python中创建可比对象? 分配一个Date对象,并将其初始化为表示自标准基准时间(即“纪元”)(即GMT 1970年1月1日)以来指定的毫秒数。 问题答案: 只需将其转换为时间戳

  • 问题内容: 我想知道如果有一种方法,因为1970年1月1日(时期),以获得当前毫秒使用新的,或Java的8类。 已知的方法如下: 要么 问题答案: 我不能完全确定“当前毫秒”的含义,但我假设这是自“纪元”(即UTC 1970年1月1日午夜)以来的毫秒数。 如果你想找到,因为时代的毫秒数 眼下, 然后用作为nubian菜鸟指出。如果是这样,则没有理由使用任何新的java.time API来执行此操作

  • 但这一个返回的是基于本地时间的毫秒。也不考虑ZoneID。 假设。如果我将其转换为具有区域id(“Asia/Kolkata”)的,那么我将得到()。然后以UTC转换为EpochMilli(1554854400000)=()。

  • 我将calendar.getTimeinMilliseconds()中的日期存储在SQLite DB中。我需要在SELECT语句中标记每个月的第一行,所以我只需要使用SQLite函数将时间以毫秒为单位转换为任何日期格式。我怎样才能避免这个?

  • 问题内容: 我有毫秒。我需要将其转换为日期格式 例: 2019年10月23日 如何实现呢? 问题答案: 需尝试以下示例代码: 希望对你有帮助…