how to make python request.get wait a few seconds?

荒凉一梦 提交于 2019-12-07 02:43:29

I would suggest use a wait until the element changes.

Find the block of code below to help you.

def wait_while(condition, timeout, delta=1):
    """
    @condition: lambda function which checks if the text contains "REALTIME"
    @timeout: Max waiting time
    @delta: time after which another check has to be made
    """
    max_time = time.time() + timeout
    while max_time > time.time():
        if condition():
            return True
        time.sleep(delta)
    return False
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!