I am trying to access the values of both the fields Year
and Quarter
from this particular site. With the help from one member of StackOverflow, I was able to implement the code for the year
part, now if I want to access the quarter
part so how can I access the same.
Below is the implementation so far.
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-error')
options.add_argument('--ignore-ssl-errors')
url = "https://lifeinsurance.adityabirlacapital.com/about-us/public-disclosure"
driver = webdriver.Chrome(executable_path='drivers/chromedriver.exe')
driver.get(url)
WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((By.CSS_SELECTOR, "div.selectize-input.items.full.has-options.has-items"))
).click()
year_dropdown = WebDriverWait(driver, 20).until(
EC.visibility_of_all_elements_located(
(By.CSS_SELECTOR, "div.selectize-dropdown-content div.option")
)
)
for year in year_dropdown:
print(year.text)
Any hints and suggestions are welcome.