Using Python and Selenium, I have tried multiple workarounds (xpath, css selector, id, etc) to capture the button on this particular page and then attempting to click on it. Nothing seems to be sticking, any solutions? Seems as though it has something to do with how the 'link' itself is written on the site I am accessing. I am trying to have the program click the 'Matrix' link below the matrix image.
My code:
from selenium import webdriver
from getpass import getpass
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome("C:\\Users\\Matt\\Documents\\WebDriver\\chromedriver_win32\\chromedriver.exe")
#This site requires log in entry so you wont be able to access it yourself.
driver.get("https://www.stellarmls.com/")
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@id='appDetailMatrix']//h4[@class='apptitle ng-star-inserted' and text()='Matrix']"))).click()
print(driver.page_source)
The website's source code for 'Matrix' link:
<h4 _ngcontent-c113="" class="apptitle ng-star-inserted" style="">Matrix</h4>
Screenshots provided for better idea of what is going on. Any recommendations would be appreciated, I have combed stackoverflow and found similar issues but their problems were resolved with very simple alterations which I tried myself to no avail.
Traceback error:
Traceback (most recent call last):
File "C:\Users\Matt\Documents\Splitt\ROI Property Finder.py", line 54, in <module>
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@id='appDetailMatrix']//h4[@class='apptitle ng-star-inserted' and text()='Matrix']"))).click()
File "C:\Users\Matt\Python3.9\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Using an Selenium IDE it informs me that the xpath should be what I have in my current code, seen below: