简体   繁体   中英

Selenium in Python: ElementNotInteractableException: Message: element not interactable

I know there are lots of posts about this exception, and I've read lots of them and tried their suggestions but they don't seem to work. Maybe you guys can see what I'm doing wrong. I'm trying to scrape this page: https://www.kichink.com/stores/barshop Specifically the information inside the little popup that apppears when clicking the "i" button next to the green "SEGUIR" button. The HTML for that button is this:

<button id="about" class="btn btn-default btn-info-store" data-toggle="popover" data-original-title="" title=""></button>

I've tried many things to click it, but I just keep getting the element not interactable exception. My last attempt was with:

element_boton = wd.find_element_by_class_name("btn.btn-default.btn-info-store")
element_boton.click()

The button seems to be correctly found, but I just can't click it.

Any suggestions?

Well, I have no idea why (so maybe someone can shed some light) but after using the full xpath (for some reason not even the relative xpath worked, it had to be the full one) to search for the button, it just started working, and i was able to click it.

element_boton = wd.find_element_by_xpath('/html/body/div[1]/div[3]/div/header/div/nav[2]/div/div['
                                                         '2]/div/ul[2]/li[1]/button')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM