【发布时间】:2022-02-10 07:16:28
【问题描述】:
在网页中,我有以下元素:
<div id="learning_form" class="learning_form">
<table cellspacing="0" cellpadding="0">
<tbody><tr><td><input type="text" id="answer" autocapitalize="off" autocorrect="off" autocomplete="off" placeholder="Odpowiedź" style="width: 360px;"></td></tr>
</tbody></table>
<div id="check"><h4 style="text-align: center;">Sprawdź</h4></div>
<div id="special_characters"><div> </div><div> </div></div>
</div>
如何在 python 中使用 selenium 在此处插入文本? 我尝试使用:
driver.find_element(By.ID,"learning_form").send_keys("some text")
但它不起作用。
元素的快照:
【问题讨论】:
-
什么是“Sprawdz”?您确定元素的 ID 正是“learning_form”吗?
标签: python selenium xpath css-selectors webdriverwait