我想要訪問位於層次結構上方的DOM元素,以訪問我有權訪問的元素。使用硒在DOM層次結構中向上移動
在Attached ScreenShot中,我想訪問#pRow_22,其中#ntsDiv_1的Grand Grand Grand Parent。但我只能訪問#ntsDiv_1。請建議我怎麼在這種情況下做
HTML代碼是這樣的: -
<tr id="pRow_22" style="border-bottom: 0;">
<td class="nameCell" style="border-bottom: 1px solid #CCCCCC;">
<div id="seller_22" class="product-sellercell">
<a id="pLogoLink_22" target="_blank" href="/norob/ClickTracker.somethins..." onclick="setMerchLb('eComElectronics.com')" rel="nofollow">
<div>
<a id="ntsLink_1" rel="nofollow" onclick="return false;" href="#">
</div>
<div id="ntsDiv_1" class="mlt-pop-container" style="width: 250px; text-align: left; white-space: normal; top: 2340px; left: 131px; visibility: hidden;">
<div class="mlt-pop-bg">
</div>
.
.
</div>
</td>
是查詢父級,直到獲得父級TR。 – vipin8169 2013-02-25 10:28:21
我該怎麼做? – vipin8169 2013-02-25 10:38:32
我必須這樣做,使用硒API,如何做到這一點 – vipin8169 2013-02-25 10:47:36