python – Unable to locate element even if it’s visible with Selenium 4

I’m trying to use Selenium with geckodriver to click some element. After page structure changed with an update, this element cannot be clicked. To open the driver I’m using:

from selenium import webdriver
from selenium.webdriver import FirefoxOptions
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

options = FirefoxOptions()
options.binary_location = r'D:\Archivos de programas\firefox.exe'
profile_path = r'C:/Users/Isaac/AppData/Roaming/Mozilla/Firefox/Profiles/lpq195ye.eloimusqueira'

options.profile = profile_path

driver = webdriver.Firefox(options=options)
driver.get('http://www.faceit.com/en/tournaments')
element = driver.find_element(By.CSS_SELECTOR, 'div.sc-cjaHrE:nth-child(4) > a:nth-child(1)')
element.click()

But I’m getting the return that it’s unable to locate the element. I’m debugging, also putting some waits so I’m sure if it’s visible for the driver but it can’t be clicked. This is weird, as for example, the other elements in the left (see picture(1)) are totally clickable without any problem. How I fix this? Thanks in advance.

Structure of the element I'm trying to click

Read more here: Source link