0

enter image description hereWhen I run my code, it is able to place username and password, but couldn't click on sign in button.

options = ChromeOptions()
options.add_argument("headless") # to hide window in 'background'
driver=Chrome(executable_path="C:/Users/samira.zade/AppData/Local/Programs/Python/Driver/chromedriver_win32/chromedriver.exe")
driver.get("https://www.adiglobaldistribution.us/MyAccount/signin")# here change your link
driver.maximize_window()
time.sleep(5)
wait=WebDriverWait(driver,50)
username = driver.find_element_by_xpath('//*[@id="SignInInfo_UserNamePage"]')
password = driver.find_element_by_xpath('//*[@id="SignInInfo_PasswordPage"]')
username.send_keys("USERNAME")
password.send_keys("PASSWORD")
# driver.find_element_by_xpath('//*[@id="userNamePasswordSignInButton"]').click()
WebDriverWait(driver, 50).until(EC.element_to_be_clickable((By.XPATH, '//* 
    [@id="userNamePasswordSignInButton"]'))).click()
samira
  • 65
  • 4
  • This code works fine for me - it clicks the "SIGN IN" button but shows "Your sign in attempt was not successful. Please try again.". – The Amateur Coder Jan 21 '22 at 19:46
  • It only shows `DeprecationWarning`s because the code uses [`find_element_by_*()` methods instead of `find_element(By.*)`](https://stackoverflow.com/questions/69875125/find-element-by-commands-are-deprecated-in-selenium) ones. – The Amateur Coder Jan 21 '22 at 19:50

0 Answers0