jeudi 28 novembre 2019

hover over a element click it not working in python. Thanks

from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Chrome("C:\\Users\\rahuls1\\chromedriver.exe") #code to get you to the page
driver.get('url')
time.sleep(2)
driver.find_element_by_id('user').send_keys('xxx')
driver.find_element_by_id('password').send_keys('xxx')
time.sleep(2)
driver.find_element_by_xpath("//input[@type='submit' and @value='Sign In']").click()
driver.maximize_window()
time.sleep(5)

popup = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="wm-shoutout-55704"]/div[3]/div[2]/div[1]')))

print ("Pop up completed")
popup.click()
time.sleep(5)

driver.find_element_by_xpath('//*[@id="__button67-BDI-content"]').click()


Dot = WebDriverWait(driver, 80).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="__button54-inner"]')))
print ("Dot completed")
Dot.click()
time.sleep(85)

driver.find_element_by_xpath('//*[@id="__toolbar4_downloadMenuItem"]').click() time.sleep(3)

wait = WebDriverWait(driver, 10) element = wait.until(EC.element_to_be_located((By.XPATH, '//*[@id="__text974"]'))) element.click()

ERROR

Traceback (most recent call last):
  File "C:\Users\rahuls1\Desktop\PYT\asp.py", line 37, in <module>
    element = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="__text974"]')))
  File "C:\Users\rahuls1\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:



Aucun commentaire:

Enregistrer un commentaire