Skip to content

Instantly share code, notes, and snippets.

@juanarrivillaga
Last active January 6, 2019 23:59
Show Gist options
  • Save juanarrivillaga/1f4e89f27fcc76582c1b4f39c88e84c0 to your computer and use it in GitHub Desktop.
Save juanarrivillaga/1f4e89f27fcc76582c1b4f39c88e84c0 to your computer and use it in GitHub Desktop.
# You can alleviate the nesting by using `and`, since your `else` statements are all equivalent up to a point
if (preset.exists('//*[@id="i0116"]', '10', '1') and log.enter_username()
and preset.exists('//*[@id="i0116"]', '10', '1') and log.enter_password()):
locked = unlock(details[0], details[1], browser, ' ', ' ', ' ')
if not (locked.checkBlocked()):
# unlock account
else:
searches = search(details[0], details[1], browser)
else:
browser.quit()
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment