Selenium is not able to click on menu button on SEC.gov page

I’m trying to get an href link to download an XBRL file for a 10-Q financial report from an SEC webpage. Selenium is able to open the webpage but then it must click on the menu button in the top left to expand the menu to get to the ‘Save XBRL Zip File’ button but fails to do so. When I run my code, the TimeoutException is raised, no matter how much waiting time is specified. The XPATH is the one selected by the element selector when I inspect the html of the opened webpage. I am very new to programming. I found similar questions but the answers did not solve my issue. Any help is greatly appreciated!

This code is a subset of my script. Selenium worked fine up to this point including clicking other buttons. In the subet, below, if there are no issues, the webpage should open and the menu should be expanded. You can left click on the menu to see the expanded form. I tried adding logging and try and except statements to debug. I have also tried all other XPATHs that seem to point to the menu button. I tried expanding the menu button using javascript with <driver.execute_script(“arguments[0].click();”, menu_button)> Causes I can think of are: a text popup for the button appears when I hover over it and might be interfering with Selenium; javascript is interfering. Since I can see the href link for the XBRL file when I inspect the webpage opened by Selenium, I tried using Beautifulsoup to get the href to no avail.

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
from selenium.common.exceptions import ElementNotInteractableException
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import ElementClickInterceptedException
from selenium.common.exceptions import StaleElementReferenceException
from selenium.common.exceptions import ElementNotVisibleException
from selenium.common.exceptions import TimeoutException


# Initialize the Edge WebDriver (I have not tried Chrome because I was having issues with the 
# driver)
driver = webdriver.Edge()

# Open the webpage
url = r'https://www.sec.gov/ix?doc=/Archives/edgar/data/0001652044/000165204424000079/goog-20240630.htm'
driver.get(url)

# Wait for the page to fully load
wait = WebDriverWait(driver, 10)

try:
    # Get the menu element
    menu_button = wait.until(EC.element_to_be_clickable((By.XPATH, "//*[@id='menu-dropdown-link']/span[2]")))

    # Logging for debugging
    print(f"Menu button displayed: {menu_button.is_displayed()}")
    print(f"Menu button enabled: {menu_button.is_enabled()}")

    # Click on the menu to expand it
    menu_button.click()

# Print exceptions for debugging
except NoSuchElementException as e:
    print("Element not found: ", e)

except ElementNotInteractableException as e:
    print("Element not interactable: ", e)

except ElementClickInterceptedException as e:
    print("Element click intercepted: ", e)

except StaleElementReferenceException as e:
    print("Stale element reference: ", e)

except ElementNotVisibleException as e:
    print("Element not visible: ", e)

except TimeoutException as e:
    print("Timeout: ", e)

The output, which I can’t understand and Copilot says is not very informative, is:

Timeout: Message:
Stacktrace:
GetHandleVerifier [0x00007FF729758162+13538]
Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF7296E1E19+595513]
(No symbol) [0x00007FF7294FE6CF]
(No symbol) [0x00007FF729542960]
(No symbol) [0x00007FF729542A1F]
(No symbol) [0x00007FF72957D627]
(No symbol) [0x00007FF72956203F]
(No symbol) [0x00007FF729538147]
(No symbol) [0x00007FF72957B1EE]
(No symbol) [0x00007FF729561C63]
(No symbol) [0x00007FF72953766E]
(No symbol) [0x00007FF72953683C]
(No symbol) [0x00007FF729537221]
Microsoft::Applications::Events::EventProperty::to_string [0x00007FF729919704+1099860]
Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF72965D8FC+53532]
Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF729650E25+1605]
Microsoft::Applications::Events::EventProperty::to_string [0x00007FF729918695+1095653]
Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF7296EC991+27777]
Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF7296E6D14+4100]
Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF7296E6E4B+4411]
Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF7296DCFD0+575472]
BaseThreadInitThunk [0x00007FFF7C437374+20]
RtlUserThreadStart [0x00007FFF7D3BCC91+33]

New contributor

catman1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật