waiter.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:explicit 作者: levi-rs 项目源码 文件源码
def find_elements(driver, elem_path, by=CSS, timeout=TIMEOUT, poll_frequency=0.5):
    """ Find and return all elements once located

    find_elements locates all elements on the page, waiting
    for up to timeout seconds. The elements, when located,
    are returned. If not located, a TimeoutException is raised.

    Args:
        driver (selenium webdriver or element): A driver or element
        elem_path (str): String used to located the element
        by (selenium By): Selenium By reference
        timeout (int): Selenium Wait timeout, in seconds
        poll_frequency (float): Selenium Wait polling frequency, in seconds

    Returns:
        list of elements: Selenium element

    Raises:
        TimeoutException: Raised when target element isn't located
    """
    wait = WebDriverWait(driver, timeout, poll_frequency)
    return wait.until(EC.presence_of_all_elements_located((by, elem_path)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号