


# https://www.globalsino.com/ICs/
# Stability of find_element().

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
import time

ser = Service(r"C:\usr\local\bin\chromedriver.exe") 
driver = webdriver.Chrome(service=ser) 
time.sleep(2)
driver.implicitly_wait(3)
driver.maximize_window()
time.sleep(2)

driver.get("https://secure.yatra.com/social/common/yatra/signin.htm")
# driver.get("https://www.google.com/")
time.sleep(3)

def find_the_element():
  # This element is on "https://secure.yatra.com/social/common/yatra/signin.htm"
  return driver.find_element(By.CSS_SELECTOR, "#login-input")
if find_the_element:
  driver.find_element(By.CSS_SELECTOR, "#login-input").send_keys("yougui.liao@gmail.com")
  print("Found the element.")
else:
  print("Cannot find the element.")

print("The execution of the program completed.")


