跟随兄弟xpath不能在我的代码中工作

时间:2015-05-13 12:10:32

标签: html selenium xpath

<html>
    <title> COSTOMER LOGIN </title>
    <body>
        <h1>FLIPKART</h1>
        <div class="ft">
            <img src="glass.jpg" height="80" width="80"/>
            <input type="button" value="100RS"/>
        </div>
        <div class="ft">
            <img src="glass.png" height="80" width="80"/>
            <input type="button" value="100RS"/>
        </div>
    </body>
</html>

在兄弟姐妹不工作之后:

//img[@src='glass.png']]/following-sibling::button[@type='button']

1 个答案:

答案 0 :(得分:1)

这不是您要查找的button代码,而是input

//img[@src='glass.png']]/following-sibling::input[@type='button']