【发布时间】:2020-09-28 20:19:09
【问题描述】:
我正在尝试使用 Python 在 Selenium 中查找输入元素。
我找不到它,因为input 在iframe 内。
我尝试切换到iframe,但我没有iframe 的ID。
代码下方:
<iframe sandbox="allow-scripts allow-same-origin" class="credit-card-iframe-cvv mt1 u-full-width" src="https://.........." frameborder="0" scrolling="no"></iframe>
这是input的代码:
<input type="tel" id="cvNumber" tabindex="0" data-shortname="cvv" maxlength="4" placeholder="XXX" class="mod-input ncss-input pt2-sm pr4-sm pb2-sm pl4-sm" autocomplete="off" value="">
不知道怎么切换,因为没有iframe的ID。
我需要在input 内写入带有发送键的 CVV 代码。
【问题讨论】:
标签: python html selenium selenium-webdriver iframe