def vote(): randomclick = random.uniform(min1, max1) randomVoteTime = random.uniform(min, max) time.sleep(randomclick) try: driver.find_element_by_xp