带有使用条款链接的复选框出现在标签内
<label class="field-item-header" for="fragment-1996782958_acceptAgreement">
I agree to the
<a target="_blank" href="example.com/terms-of-use">Terms of Use.</a>
</label>
以前我可以点击复选框,但现在点击的是使用条款链接
我已经使用了下面的xpath来定位复选框
I_AGREE_CHECKBOX = By.xpath("//div[@class='account-information']/fieldset[2]/ul/li[2]/span[1]/label");
和
I_AGREE_CHECKBOX = By.xpath("//*[contains(text(), 'I agree to the')]");
请告诉我一些想法,这样我就可以只点击复选框,而不是使用条款,谢谢
发布于 2015-02-23 16:05:10
尝试使用以下表达式:
//*[text()[contains(.,'I agree to the'))]]
https://stackoverflow.com/questions/28668275
复制相似问题