Advertisement
Guest User

Selenium Login dont work

a guest
Oct 9th, 2022
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.98 KB | None | 0 0
  1. from selenium import webdriver
  2. from selenium.webdriver.chrome.service import Service
  3. from selenium.webdriver.chrome.options import Options
  4. from selenium.webdriver.support.ui import WebDriverWait
  5. from selenium.webdriver.common.by import By
  6. from selenium.webdriver.support import expected_conditions as EC
  7.  
  8. options = Options()
  9. options.add_argument("start-maximized")
  10.  
  11. webdriver_service = Service('C:\webdrivers\chromedriver.exe')
  12. driver = webdriver.Chrome(options=options, service=webdriver_service)
  13. wait = WebDriverWait(driver, 10)
  14.  
  15. url = "https://portal.librus.pl/rodzina/synergia/loguj"
  16.  
  17. driver.get(url)
  18. wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a.btn.btn-third.btn-synergia-top.btn-navbar.dropdown-toggle"))).click()
  19. wait.until(EC.element_to_be_clickable((By.XPATH, "/html/body/nav/div/div[1]/div/div[2]/div/a[2]"))).click()
  20. wait.until(EC.element_to_be_clickable((By.XPATH, "/html/body/main/div/div/div/div[1]/div[3]/div[1]/div[1]/input"))).send_keys("my username")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement