gpt4 book ai didi

Python Selenium - 属性错误 : WebElement object has no attribute sendKeys

转载 作者:太空狗 更新时间:2023-10-29 20:39:25 26 4
gpt4 key购买 nike

我正在尝试使用 Selenium (Python) 将“ENTER”传递给文本字段。文本框要求在新行中输入每个电话号码,因此它看起来像:

#Add the phone number#
Webelement.sendKeys(Keys.ENTER)

我导入了以下库:

from selenium.webdriver.common.keys import Keys

我遇到的问题是它失败了:

AttributeError: 'WebElement' object has no attribute 'sendKeys'

有人知道怎么解决吗?我一直在寻找解决方案,但一无所获。

最佳答案

尝试使用 WebElement::send_keys()而不是 sendKeys 如下:-

from selenium.webdriver.common.keys import Keys

Webelement.send_keys(Keys.ENTER)

关于Python Selenium - 属性错误 : WebElement object has no attribute sendKeys,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38521136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com