【发布时间】:2012-03-10 18:03:16
【问题描述】:
/* 回头客登录
<h2>
<label for="ctl00_Login2_UserName" id="ctl00_Login2_UserNameLabel">Email</label>
<br />
<input name="ctl00$Login2$UserName" type="text" value="pallavi@ensarm.com" maxlength="100" id="ctl00_Login2_UserName" class="formstyle2" style="width:150px;" />
<span id="ctl00_Login2_UserNameRequired" title="User Name is required." style="color:Red;visibility:hidden;">*</span>
<br />
<br />
<label for="ctl00_Login2_Password" id="ctl00_Login2_PasswordLabel">Password</label>
<br />
<input name="ctl00$Login2$Password" type="password" maxlength="100" id="ctl00_Login2_Password" class="formstyle2" style="width:150px;" />
<span id="ctl00_Login2_PasswordRequired" title="Password is required." style="color:Red;visibility:hidden;">*</span>
<a id="ctl00_Login2_ForgottenPasswordLink" href="ForgottenPassword.aspx">Forgotten password?</a>
</h2>
<h2 align="right">
<span id="ctl00_Login2_FailureText" style="color:Red;">Your login attempt was not successful. Please try again.</span>
<div class="button_right button_fixedwidth">
<a id="ctl00_Login2_ibnLogin" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$Login2$ibnLogin", "", true, "Login2", "", false, true))">Login</a>
</div>
</h2>
</div>
*/
上面是我的 html 页面源,我想要跨度的 xpath 表达式,ID 为 ctl00_Login2_FailureText。位于 div/h2 内
我已经尝试了以下 xpath,但它不起作用: //span[@id='ctl00_Login2_FailureText' and contains(text(),'您的帐户已被暂时锁定,因为错误登录尝试的最大次数。')]
【问题讨论】:
-
span和@id = 'ctl00_Login2_FailureText'在提供的 XML 示例中不包含Your account has been temporarily locked because of a maximum number of incorrect login attempts....
标签: xpath