Python Selenium - AttributeError : WebElement object has no attribute sendKeys

Python Selenium - AttributeError : WebElement object has no attribute sendKeys

我正在尝试使用 Selenium (Python) 通过 "ENTER" 传递到文本字段。文本框要求每个 phone 数字在一个新行中输入,因此它看起来像:

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