使用selenium python web驱动程序检索表行数据

时间:2015-11-15 10:51:05

标签: angularjs python-3.x selenium-webdriver

我有一个带有角网格样式的行的表。我的要求是使用selenium webdriver for python根据某些条件获取特定的表行及其数据。我熟悉在selenium中检索普通的html表数据,但我不知道如何为基于角度网格的表执行此操作。有人可以给我指示这个。以下是我正在处理的表格:

<div class="ag-body-viewport-wrapper" style="margin-left: 0px;">
<div class="ag-body-viewport">
<div class="ag-body-container" style="width: 1117px; height: 5291px;">
<div class="ag-row ag-row-odd ag-row-level-0 ng-scope" style="top: 333px; height: 37px; width: 1117px;" row="9" v_element_id="342">
<div class="ag-cell ag-cell-no-focus cell-col-0 ag-cell-value" style="width: 225px;" tabindex="-1" col="0" v_element_id="343">satsite1447401448</div>
<div class="ag-cell ag-cell-no-focus cell-col-1 ag-cell-value" style="width: 223px;" tabindex="-1" col="1" v_element_id="344"> </div>
<div class="ag-cell ag-cell-no-focus cell-col-2 ag-cell-value" style="width: 223px;" tabindex="-1" col="2" v_element_id="345"> </div>
<div class="ag-cell ag-cell-no-focus cell-col-3 ag-cell-value" style="width: 223px;" tabindex="-1" col="3" v_element_id="346"></div>
<div class="ag-cell ag-cell-no-focus cell-col-4 ag-cell-value" style="width: 223px;" tabindex="-1" col="4" v_element_id="347"> </div>
</div>
<div class="ag-row ag-row-even ag-row-level-0 ng-scope" style="top: 370px; height: 37px; width: 1117px;" row="10" v_element_id="348">
<div class="ag-cell ag-cell-no-focus cell-col-0 ag-cell-value" style="width: 225px;" tabindex="-1" col="0" v_element_id="349">satsite1447401948</div>
<div class="ag-cell ag-cell-no-focus cell-col-1 ag-cell-value" style="width: 223px;" tabindex="-1" col="1" v_element_id="350"> </div>
<div class="ag-cell ag-cell-no-focus cell-col-2 ag-cell-value" style="width: 223px;" tabindex="-1" col="2" v_element_id="351"> </div>
<div class="ag-cell ag-cell-no-focus cell-col-3 ag-cell-value" style="width: 223px;" tabindex="-1" col="3" v_element_id="352"></div>
<div class="ag-cell ag-cell-no-focus cell-col-4 ag-cell-value" style="width: 223px;" tabindex="-1" col="4" v_element_id="353"> </div>
</div>
<div class="ag-row ag-row-odd ag-row-level-0 ng-scope" style="top: 407px; height: 37px; width: 1117px;" row="11" v_element_id="354">
<div class="ag-cell ag-cell-no-focus cell-col-0 ag-cell-value" style="width: 225px;" tabindex="-1" col="0" v_element_id="355">satsite1447462846</div>
<div class="ag-cell ag-cell-no-focus cell-col-1 ag-cell-value" style="width: 223px;" tabindex="-1" col="1" v_element_id="356"> </div>
<div class="ag-cell ag-cell-no-focus cell-col-2 ag-cell-value" style="width: 223px;" tabindex="-1" col="2" v_element_id="357"> </div>
<div class="ag-cell ag-cell-no-focus cell-col-3 ag-cell-value" style="width: 223px;" tabindex="-1" col="3" v_element_id="358"></div>
<div class="ag-cell ag-cell-no-focus cell-col-4 ag-cell-value" style="width: 223px;" tabindex="-1" col="4" v_element_id="359"> </div>
</div>

0 个答案:

没有答案