简体   繁体   English

Python 中的 Selenium:ElementNotInteractableException:消息:元素不可交互

[英]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.我正在尝试抓取此页面: https://www.kichink.com/stores/barshop特别是单击绿色“SEGUIR”按钮旁边的“i”按钮时出现的小弹出窗口内的信息。 The HTML for that button is this:该按钮的 HTML 是这样的:

<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.好吧,我不知道为什么(所以也许有人可以解释一下)但是在使用完整的 xpath 之后(由于某种原因,甚至相对的 xpath 都不起作用,它必须是完整的)搜索按钮,它才开始工作,我能够点击它。

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')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python selenium ElementNotInteractableException:消息:元素不可交互 - Python selenium ElementNotInteractableException: Message: element not interactable ElementNotInteractableException:元素在 Selenium 中不可交互 - ElementNotInteractableException: element not interactable in Selenium ElementNotInteractableException:消息:元素不可交互 - ElementNotInteractableException: Message: element not interactable selenium.common.exceptions.ElementNotInteractableException:消息:使用Selenium和Python插入值时元素不可交互 - selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable while inserting value using Selenium and Python ElementNotInteractableException:消息:元素不是元素不可交互错误使用 Selenium 和 Python 将文本发送到 Email 字段 - ElementNotInteractableException: Message: element not element not interactable error sending text to Email field using Selenium and Python ElementNotInteractableException:消息:使用 Selenium 和 Python 将文本发送到 Quora 上的电子邮件字段时,元素不可交互错误 - ElementNotInteractableException: Message: element not interactable error while sending text to Email field on Quora using Selenium with Python ElementNotInteractableException:消息:使用 Selenium Python 在搜索字段中发送文本的元素不可交互错误 - ElementNotInteractableException: Message: element not interactable error sending text in search field using Selenium Python Selenium.common.exceptions.ElementNotInteractableException:消息:元素在离子框架中不可交互 - Selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable in ionic framework 发现 selenium.common.exceptions.ElementNotInteractableException:消息:元素不可交互 - Found selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable 错误是“selenium.common.exceptions.ElementNotInteractableException:消息:元素不可交互” - error is “selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM