I'm creating a Greasemonkey script which reads and stores information from a text-based game into a database to use in the future.
What I want is to be able to read the user's stats and turn those stats into variables so that I can proceed with making the information useful.
Here is the source code of the table which I want to grab the stats info from:
<table width="100%">
<tr>
<td width="50%" valign="top" style="padding-right: 25px;">
<table class="table_lines" width="100%" cellspacing="0" cellpadding="6" border="0">
<tr>
<th colspan="3">Military Effectiveness</th>
</tr>
<tr>
<td><b>Strike Action</b></td>
<td align="right">16,376,469,657</td>
<td align="right">Ranked #443</td>
</tr>
<tr>
<td><b>Defensive Action</b></td>
<td align="right">4,016,716,436</td>
<td align="right">Ranked #569</td>
</tr>
<tr>
<td><b>Spy Rating</b></td>
<td align="right">12,245,896</td>
<td align="right">Ranked #1,204</td>
</tr>
<tr>
<td><b>Sentry Rating</b></td>
<td align="right">5,291,630,090</td>
<td align="right">Ranked #831</td>
</tr>
</table>
Now as you can see the stats don't have identifying class IDs or anything, so I'm not sure how to do this. I only really use PHP, so JavaScript is very new to me but it seems similar to PHP.
Maybe something that says "After <td><b>Strike Action</b></td>
, grab the first td value" and then put it as a variable?
NOTE: Strike Action, Defensive Action, Spy Rating, and Sentry Rating are the variables I need.