Python Selenium-AttributeError:WebElement对象在textarea中没有属性sendKeys

echochio chio

我的代码:

from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
driver=webdriver.Firefox()
driver.get("http://www.58yumi.com/")
driver.find_element_by_id("UserName").send_keys("XXXXXXX")
driver.find_element_by_id("Password").send_keys( "XXXXXX")
driver.find_element_by_xpath("//*[contains(@type,'submit')]").click()
driver.get("http://www.58yumi.com/user_jiexi.htm")
driver.find_element_by_id("cznr").sendKeys("XXXX.com|forcname|CNAME|forcname.XXXX.com.a.bdydns.com|default");
......

我在element_by_id(“ cznr”)中收到错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'WebElement' object has no attribute 'sendKeys'

html:

<textarea id="cznr" onkeyup="czhang();" name="ymlb" cols="60" class="inputs2" rows="10"></textarea>

帮助....如何在textarea中输入数据?

DebanjanB

将该行中的基于Java的方法替换sendKeys()基于Python的方法send_keys()

driver.find_element_by_id("cznr").sendKeys("XXXX.com|forcname|CNAME|forcname.XXXX.com.a.bdydns.com|default");

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Selenium Python AttributeError:'WebElement'对象没有属性'select_by_visible_text'

AttributeError:将函数“选择”移动到Django时,使用Selenium Python将“ WebElement”对象没有属性“ copy”错误

AttributeError:“列表”对象没有属性“替换” Selenium Python

“WebElement”类型的对象没有 len() - Python Selenium

AttributeError:“列表”对象使用Selenium和Python没有属性“单击”

Selenium w / Python3-AttributeError:“ str”对象没有属性“ tag_name”

Python Selenium Webdriver:AttributeError'list'对象没有属性'tag_name'

Selenium Python AttributeError:“ NoneType”对象没有属性“ send_keys”

python中的AttributeError:对象没有属性

迭代Selenium / Python中的WebElement

selenium python 错误“dict”对象没有属性“click”

Selenium'WebElement'对象没有属性'Get_Attribute'

Selenium / Python TypeError:“ WebElement”对象不可迭代

WebElement类型的Selenium对象没有len()

AttributeError:“ bytes”对象在python 3中没有属性“ encode”

AttributeError:“ DataFrame”对象在Python中没有属性“ colmap”

AttributeError: 'tuple' 对象在 Python 3 中没有属性 'get'

AttributeError:“ ElementTree”对象在Python中没有属性“ tag”

AttributeError: 'NoneType' 对象在 python 中没有属性 'text'

AttributeError:“ NoneType”对象在python中没有属性“ lower”

AttributeError: 'Screen' 对象在 Python KivyMD 中没有属性 'text'

:{AttributeError:“ int”对象在Python中没有属性“ config”

AttributeError:“列表”对象在python中没有属性“显示”

AttributeError:“ filter”对象在Python 3中没有属性“ replace”

Selenium AttributeError 'list' 对象没有属性 send_keys

Python - AttributeError:对象没有属性“tk”

python AttributeError'dict'对象没有属性

Python - AttributeError: 'DataFrame' 对象没有属性

Selenium (Python) 中的 StaleElementReferenceException