Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. def drive():
  2.     """Drive program.
  3.  
  4.    Sleep for 5 seconds, then refresh page.  If there are available hours,
  5.    click on them.  If no available hours, then reset loop.
  6.    """
  7.     while True:
  8.         time.sleep(5)
  9.         driver.refresh()
  10.         html = driver.page_source
  11.         html_soup = soup(html, "html.parser")
  12.         hour_container = html_soup.findAll("li", {"class": "available"})
  13.         if not hour_container:
  14.             continue
  15.         for hour in hour_container:
  16.             hour.click()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement