I am writing a greasemonkey script that parses a page with the following general structure:
<table>
<tr><td><center>
<b><a href="show.php?who=IDNumber">(Account Name)</a></b>
(#IDNumber)
<br> (Rank)
<br> (Title)
<p>
<b>Statistics:</b>
<br>
<table>
<tr><td>blah blah etc.
</td></tr></table></center></table>
I am specifically trying to extract the (Title) part from this. However, as you can see, it is sent only by a tag <BR>, does not have its own identifier, is only part of the tag text <CENTER>, and this tag has a whole raft of other text associated with it.
Right now, what am I doing to get this, take the innerHTML of the Center tag and use the regular expression for it for /<br>([A-Za-z ]*)<p><b>Statistics/. This works well for me, but it seems like it's best to select this text.
... So, is there a better way? Or should I complain to the programmer on the site that he needs to make this text more accessible? :-)