I want to webscrape the following website: https://sprs.parl.gov.sg/search/home
But when my code clicks on the "Search button", I get the error:
ElementClickInterceptedException: element click intercepted: Element is not clickable at point (320, 1395)
I am not sure if it's because the Search button is not completely visible and needs scrolling down. If so, how do I scroll down the page using Selenium?
Code trials:
from bs4 import BeautifulSoup as bs
from selenium import webdriver
import time
driver = webdriver.Chrome(executable_path="C:/Users/chromedriver.exe")
page_url = 'https://sprs.parl.gov.sg/search/home'
driver.get(page_url)
# Get search box and fill it up
search = driver.find_element_by_css_selector('#divmpscreen2 > div.row > div:nth-child(1) > div > div:nth-child(1) > input')
search.send_keys('COS')
# This will select the 13th parliament
session = driver.find_element_by_xpath("//select/option[contains(text(), '13th')]")
session.click()
time.sleep(10)
# Find submit element and click
submit = driver.find_element_by_xpath("//button[@label='Search']/em")
submit.click()