新启用JS的页面http://mail.google.com无法获取密码输入字段的 ID。但是,我已使用其 ID - identifierID
从电子邮件 ID 页面导航。
如何获取密码字段的ID?
最佳答案
相反,如果 Id 使用 name 属性来访问该字段。
document.getElementsByName("password")[0];
它将为您提供密码输入元素。
<input type="password" class="whsOnd zHQkBf" jsname="YPqjbf" autocomplete="current-password" spellcheck="false" tabindex="0" aria-label="Enter your password" name="password" autocapitalize="off" autocorrect="off" dir="ltr" data-initial-dir="ltr" data-initial-value="">
关于javascript - 如何使用selenium Webdriver获取gmail的密码输入字段ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44738306/