我在與下面的代碼有問題:蟒蛇硒excpected條件send_keys
iFrame = EC.frame_to_be_available_and_switch_to_it(("MAIN_IFRAME"))
uscita = EC.presence_of_element_located((By.XPATH, "//input[contains(.,'password')]"))
uscita.send_keys('passwd')
,我發現了以下錯誤:
AttributeError: 'presence_of_element_located' object has no attribute 'send_keys'
我是新Python的用戶,我希望你對這個問題的幫助。
感謝
HTML的iframe和輸入:
<td style="text-align:center">
<iframe height="350" width="450" name="timb" src="timb.php" style="position: relative;top:0px"></iframe>
</td>
<td>
<div style="position: relative;top:0px">
<form action="mnghlog6.php" method="post" target="timbri">
<input type="hidden" id="esculappio" name="escu" value="0">
<table style="position: relative;top:0px">
</div></td><td><div class="buttons" style="display:inline;text-align: left;">
</div></td></tr><tr><td><div class="buttons" style="display:inline;text-align: left;">
</div></td><td><div class="buttons" style="display:inline;text-align: left;">
</div></td></tr></tbody></table> </div>
</td>
</tr>
<tr>
<td style="text-align:center">Password <input type="password" name="password" id="password" size="30" value=""></td>
</tr>
</tbody></table>
<input type="hidden" name="tipo" value="">
<input type="hidden" name="flag_inizio">
<input type="hidden" name="durata">
</form>
</div>
</td>
</tr>
框架在http://selenium-python.readthedocs.io/waits.html '看看presence_of_element_located'返回給你'明確的等待',你需要解析使用等待元素。 –
你可以分享你的HTML框架和輸入以及。 –
我從html中省略了一些代碼,因爲這裏沒有被接受。 –