Skip to content

A library to wait for websites to load, files to download, a method to return, etc...

Notifications You must be signed in to change notification settings

GitPushPullLegs/wait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wait

A library to wait for websites to load, files to download, a method to return, etc...

Installation:

pip install git+https://github.com/GitPushPullLegs/wait.git

Quickstart:

Waiting for any function to return

from wait import Wait
from random import randrange

def function_that_needs_to_return():
    if randrange(10) == 2:
        return "It's 2!"

result = Wait(timeout=60, poll_frequency=1.5).until(function_that_needs_to_return)  # Notice the lack of ().
print(result)

Waiting for a download to complete

from wait import BrowserWait
from selenium import webdriver

# A random selenium chrome driver.
driver_path = 'path_to_chrome_driver'
driver = webdriver.Chrome(executable_path=driver_path)

file_path = BrowserWait(driver=driver).until_file_downloaded()

print(file_path)  # The file path to the downloaded file.

About

A library to wait for websites to load, files to download, a method to return, etc...

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages