Skip to content

Instantly share code, notes, and snippets.

@thunderInfy
Last active May 27, 2021 21:49
Show Gist options
  • Select an option

  • Save thunderInfy/5216e04a46ffa04cf45fb3203d1c78a0 to your computer and use it in GitHub Desktop.

Select an option

Save thunderInfy/5216e04a46ffa04cf45fb3203d1c78a0 to your computer and use it in GitHub Desktop.
try:
pincodefieldobj = WebDriverWait(browser, delay).until(EC.presence_of_element_located((By.XPATH, pincodefield)))
pincodefieldobj.send_keys(pin)
loginsubmitobj = WebDriverWait(browser, delay).until(EC.presence_of_element_located((By.XPATH, login_submit)))
loginsubmitobj.click()
age18p = WebDriverWait(browser, delay).until(EC.presence_of_element_located((By.XPATH, age18plus)))
age18p.click()
myElem = WebDriverWait(browser, delay).until(EC.presence_of_element_located((By.XPATH,databasepath)))
soup = BeautifulSoup(myElem.get_attribute('innerHTML'), 'html.parser')
df = construct_df(soup)
# call if number of doses for dose 1 is greater than 0
mask = np.column_stack([df[col].str.contains(r"D1 [1-9][0-9]*") for col in df])
if mask.any():
dial()
count += 1
except TimeoutException:
print("Loading took too much time!")
browser.quit()
if count == 3:
break
time.sleep(600)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment