Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all sleeps #12

Open
banool opened this issue Dec 4, 2017 · 0 comments
Open

Remove all sleeps #12

banool opened this issue Dec 4, 2017 · 0 comments
Labels

Comments

@banool
Copy link
Owner

banool commented Dec 4, 2017

Substantial work has been made on this already compared to where it was, but the script still has a few points where sleeping is used. Waiting for the page to load with a real time sleep is bad for at least two big reasons on each end of the spectrum:

  1. Wait too long and the script is slower without needing to be.
  2. Wait too little and the page will not have loaded, probably crashing the script.

The better approach would be to keep trying to find the appropriate element with a small delay in between each attempt, catching the exception when it hasn't yet loaded. There is a decorator in util for this already, but it doesn't play with generators very nice. The success condition is also quite strange, expecting each function to return None on failure.

Breaking all of the navigation functions into smaller pieces would likely still be good for this.

@banool banool added the refactor label Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant