Pns 343
Pns 343
import time
import datetime
# from selenium.webdriver.chrome.options import Options
from selenium.webdriver.firefox.options import Options
import twilio
from twilio.rest import Client
if __name__ == "__main__":
##############################################################
while True:
try:
# check for Blue card slot
print("Checking for Bluecard category")
firefox_options = Options()
# open in headless mode to run in background
firefox_options.headless = True
# firefox_options.add_argument("start-maximized")
# following options reduce the RAM usage
firefox_options.add_argument("disable-infobars")
firefox_options.add_argument("--disable-extensions")
firefox_options.add_argument("--no-sandbox")
firefox_options.add_argument("--disable-application-cache")
firefox_options.add_argument("--disable-gpu")
firefox_options.add_argument("--disable-dev-shm-usage")
driver = webdriver.Firefox(options=firefox_options)
# make sure that the browser is full screen, else some buttons will not
be visible to selenium
driver.maximize_window()
# logging in
time.sleep(
10
) # sleep provides sufficient time for all the elements to get visible
uname = driver.find_element_by_xpath("//input[@id='mat-input-0']")
uname.send_keys(vfs_email_address)
pwd = driver.find_element_by_xpath("//input[@id='mat-input-1']")
pwd.send_keys(vfs_account_password)
sign_in_button = driver.find_element_by_xpath("//button/span")
sign_in_button.click()
time.sleep(10)