Jan-04-2018, 02:49 AM
Hi,
I am scraping data from a web page but none of the items have an ID. I'm struggling to find an example so here goes...
The table looks like such:
There are several tables on the page but to uniquely identify the one above, I'd want something like:
find/findall in table. Unique identifier: summary="Transactions statistics summary table"
for each row in the table, extract values. Unique identifier: class="Verdana2">
I want to retrieve the values:
Transaction Name
LraMinimum
Average
Maximum
Std. Deviation
80 Percent
Pass
Fail
Stop
Hope that makes sense?
Cheers,
J
I am scraping data from a web page but none of the items have an ID. I'm struggling to find an example so here goes...
The table looks like such:
Output:<table style = " border-collapse: collapse;" border="0" cellPadding="0" summary="Transactions statistics summary table" class="750WidthClass" >
<tr bgcolor="330066" >
<td id="LraTransaction Name " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">Transaction Name </span></td>
<td id="Status" class="table_header" vAlign="top" width="80"><span class="Verdana2">SLA Status</span></td> <td id="LraMinimum " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">Minimum </span></td>
<td id="LraAverage " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">Average </span></td>
<td id="LraMaximum " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">Maximum </span></td>
<td id="LraStd. Deviation " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">Std. Deviation </span></td>
<td id="Lra80 Percent " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">80 Percent </span></td>
<td id="LraPass " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">Pass </span></td>
<td id="LraFail " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">Fail </span></td>
<td id="LraStop " class="table_header_for_html_report" vAlign="top"><span class="Verdana2">Stop </span></td>
</tr>
</table>
All examples online point to using ID. But that doesn't exist.There are several tables on the page but to uniquely identify the one above, I'd want something like:
find/findall in table. Unique identifier: summary="Transactions statistics summary table"
for each row in the table, extract values. Unique identifier: class="Verdana2">
I want to retrieve the values:
Transaction Name
LraMinimum
Average
Maximum
Std. Deviation
80 Percent
Pass
Fail
Stop
Hope that makes sense?
Cheers,
J