我想找到硒2與C#標籤,但我不能訪問與ID或XPath或等div標籤這是我的代碼:如何在Selenium 2 WebDriver中選擇div ID?
driver.FindElement(By.Id("captcha"));
和網頁源:
<body id="mainBody">
<div class="top_bar" style="min-height:210px">
<div class="m_sidebar_view">
<div id="captcha" style="position: relative; float: right; margin: 6px 35px 0 0; overflow: auto;"><div/>
</div>
</div>
</body>
試試這個XPath:切換到它搜索的驗證碼元素之前「// DIV [@類='top_bar 」]/DIV/DIV「 –
你用它想要什麼 –