Код: Выделить всё
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver=webdriver.Chrome()
try:
# Open the NSE announcements page
driver.get("https://www.nseindia.com/companies-listing/corporate-filings-announcements")
time.sleep(10)
# Wait for the page to load and display the download button
WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.XPATH, "//a[contains(text(), 'CFanncEquity-download')]"))
)
time.sleep(5)
# Click on the download button for CSV
download_button = driver.find_element(By.XPATH, "//a[contains(text(), 'CFanncEquity-download')]")
download_button.click()
# Wait for a few seconds to ensure download completes
time.sleep(15)
finally:
# Close the browser
driver.quit()
Вот ошибка при выполнении приведенного выше фрагмента кода:
Код: Выделить всё
Traceback (most recent call last): File "F:\automation\test.py", line 14, in WebDriverWait(driver, 10).until( File "F:\environ\env_data\Lib\site-packages\selenium\webdriver\support\wait.py", line 105, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Stacktrace: GetHandleVerifier [0x00007FF609F080D5+2992373] (No symbol) [0x00007FF609B9BFD0] (No symbol) [0x00007FF609A3590A] (No symbol) [0x00007FF609A8926E] (No symbol) [0x00007FF609A8955C] (No symbol) [0x00007FF609AD27D7] (No symbol) [0x00007FF609AAF3AF] (No symbol) [0x00007FF609ACF584] (No symbol) [0x00007FF609AAF113] (No symbol) [0x00007FF609A7A918] (No symbol) [0x00007FF609A7BA81] GetHandleVerifier [0x00007FF609F66A2D+3379789] GetHandleVerifier [0x00007FF609F7C32D+3468109] GetHandleVerifier [0x00007FF609F70043+3418211] GetHandleVerifier [0x00007FF609CFC78B+847787] (No symbol) [0x00007FF609BA757F] (No symbol) [0x00007FF609BA2FC4] (No symbol) [0x00007FF609BA315D] (No symbol) [0x00007FF609B92979] BaseThreadInitThunk [0x00007FFC22E6259D+29] RtlUserThreadStart [0x00007FFC24D6AF38+40]
Подробнее здесь: https://stackoverflow.com/questions/793 ... csv-button