Trying to select other financial statements (default is income statement), as well as toggle between the second list of Annual/Quarterly. I can narrow down to get the attributes of the lists but I'm not able to interact with the list.
import time
import urllib.request
from bs4 import BeautifulSoup
from selenium import webdriver
symbol = 'bmo'
driver = webdriver.Chrome()
driver.get('https://web.tmxmoney.com/financials.php?qm_symbol={}'.format(symbol))
time.sleep(2)
dropdown = driver.find_elements_by_css_selector('a.qmod-dropdown_toggle.qmod-type-toggle + ul.qmod-dropdown-menu > li > a')
for option in dropdown:
if option.get_attribute('innerText') == 'Balance Sheet':
option.send_keys('Balance Sheet')