I tried to build a code to repeat the search on a website. I follow a number of method from the forum but still failed to resolve the below issue. Below error message was popped up when I tried to click the checkbox "Ensuite". See if anyone knows how to resolve it.
Error Message selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element ... is not clickable at point (323, 690). Other element would receive the click: ...
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 import webdriver
web = webdriver.Chrome()
url = 'https://www.spareroom.co.uk/flatshare/search.p'
wait = WebDriverWait(web, 20)
web.get(url)
wait.until(EC.element_to_be_clickable((By.ID, 'onetrust-accept-btn-handler'))).click()
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'div.panel-tab > a:nth-child(2)'))).click()
web.find_element(By.ID, "search_by_location_field").clear()
web.find_element(By.ID, "search_by_location_field").send_keys("KT5")
web.find_element(By.ID,"search-button").click()
web.maximize_window()
#To check the "Ensuite" checkbox ==> failed to select the option and with error
wait.until(EC.element_to_be_clickable((By.XPATH, '/html[1]/body[1]/main[1]/div[2]/aside[1]/form[1]/div[1]/div[1]/section[7]/div[3]/div[1]'))).click()
#To click the button "Apply filters"
wait.until(EC.element_to_be_clickable((By.XPATH, '/html[1]/body[1]/main[1]/div[2]/aside[1]/form[1]/div[1]/div[1]/div[1]/div[1]/button[1]'))).click()
Aucun commentaire:
Enregistrer un commentaire