Could not create .click () element on button.

Code on the site:

<button class="btn__type btn__type_close">Закрыть</button> 

How do I try to make an element clickable:

 driver.execute_script("return document.getElementsByClassName('.btn__type_close')").click() 

Question: - How will it be right?

    1 answer 1

     driver.find_element_by_css_selector('button.btn__type_close').click() 
    • Already did so .. does not pass ... Here is what he writes: "selenium.common.exceptions.WebDriverException: Message: unknown error: Element <button class =" btn__type btn__type_close "> ... </ button> is not clickable at point (574, 535). <Div class = "form__group"> ... </ div> " - nikvand
    • @nikvand means, obviously, the button for some reason is not clickable. And for what - you already know better, you didn’t show us the html-code of the page and its state at the time of the click - andreymal
    • @nikvand, the button is overlapped by the <div class="form__group">...</div> . Add to the question the html of this piece with the button - suit