This time, I don't know why I can't click the button that I could click it before. So I change the way to click the button to use JavaScript to click.
This commit is contained in:
+3
-1
@@ -73,7 +73,9 @@ class BUCTAU:
|
||||
try:
|
||||
driver.find_element(By.XPATH, '/html/body/main/section/div[1]/div[2]/input').send_keys(self.USER_USERNAME)
|
||||
driver.find_element(By.XPATH, '//*[@id="password"]').send_keys(self.USER_PASSWORD)
|
||||
driver.find_element(By.XPATH, '/html/body/main/section/div[1]/div[8]/button[1]').click()
|
||||
login_button = driver.find_element(By.XPATH, '/html/body/main/section/div[1]/div[8]/button[1]')
|
||||
driver.execute_script("arguments[0].click();", login_button)
|
||||
# driver.find_element(By.ID,"login-account").click()
|
||||
return True
|
||||
except selenium.common.exceptions.NoSuchElementException as e:
|
||||
logging.info("NoSuchElementException: ", e)
|
||||
|
||||
@@ -5,7 +5,7 @@ from Authtication import BUCTAU
|
||||
def main():
|
||||
"""Main function to run the script."""
|
||||
authenticator = BUCTAU()
|
||||
driver = authenticator.init_driver_chrome()
|
||||
driver = authenticator.init_driver_edge()
|
||||
past_time = time.time()
|
||||
while True:
|
||||
if time.time() - past_time > 10.0:
|
||||
|
||||
Reference in New Issue
Block a user