我有以下 HTML 结构,我正在尝试使用 Selenium 输入值NUM
:
<div class="MY_HEADING_A">
<div class="TitleA">My title</div>
<div class="Foobar"></div>
<div class="PageFrame" area="W">
<span class="PageText">PAGE <input id="a1" type="txt" NUM="" /> of <span id="MAX"></span> </span>
</div>
这是我写的代码:
head = driver.find_element_by_class_name("MY_HEADING_A")
frame_elem = head.find_element_by_class_name("PageText")
# Following is a pseudo code.
# Basically I need to enter a value of 1, 2, 3 etc in the textbox field (NUM)
# and then hit RETURN key.
## txt = frame_elem.find_element_by_name("NUM")
## txt.send_keys(Key.4)
如何获取这个元素并输入一个值?</p>