I'm new to Selenium and trying to undertake a live example of web-scraping a list using the following URL - https://mcscertified.com/find-an-installer/
However, I'm struggling to click on a drop-drown 'What would you like to install?' to expose more check boxes, 'Solar PV'.
Below is my work in progress code which works, except for the 'What would you like to install?' drop-down.
Would love any advice or pointers. I have commented out my code that does not work.
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
opts = webdriver.FirefoxOptions()
serv = webdriver.FirefoxService( executable_path='/snap/bin/geckodriver' )
driver = webdriver.Firefox( options=opts, service=serv )
driver.get('https://mcscertified.com/find-an-installer/')
# Delay to let page load
time.sleep(5)
# click allow button
btn_allow = driver.find_element(By.ID,"CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll")
btn_allow.click()
# click 'What would you like installed?
# WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//span[normalize-space()='msw-arrow']"))).click()
# WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//label[contains(., 'msw-arrow')]"))).click()
# click Solar PV checkbox
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//label[contains(., 'Solar PV')]"))).click()
# click 'What would you like All of UK?'
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//label[contains(., 'All of the UK')]"))).click()
btn_allow = driver.find_element(By.ID, "msw-installer-launchpad-search-installers-tech-type")
btn_allow.click()
I'll add in the HTML once I understand it from the source:-
Many thanks