Firstly I will admit I suck at expressions and any help someone can give will be wholely appreciated. I'm going to provide as much information as I can think would be useful here so hopefully some kind person who knows expressions well can guide me.
I am writing a parser which grabs the contents of a certain HTML file (passed as an argument on the command line) and then loads up the HTML file, parses through it to find each of the relevant chunks of data and then will grab each of those chunks and grab all of the relevant variables from within each and load it all into a big happy multidimensional associative array.
The contents of the file in question will vary, but the layout will be static. FYI, the contents of the file are skills of players in a game of virtual soccer team management played online. First, I need the parser function to match each chunk of player code (they are all identical, so it should be possible) and then as it grabs each chunk, it would be ideal if there is a way to identify each part of that code which is a value.
You can view the entire HTML file for starters at the following URL:
http://onions.dyndns.org:8080/~justin/players.asp.html
If you first view the page as html, you can see that it contains information about several players. Viewing the source, I have identified each player is contained within a table which looks like the code chunk quoted below.
The data I need to pull out are the playerID (the easy part) and then each of the player's attributes listed in the nested table (such as Passing, Winger, Scoring, etc).
This is really complicated and I'm hoping that what I want to do is even possible. Any advice is greatly appreciated!
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR><TD valign="top"><div class="back">
<div class="back2"><img src="images/dresses/back/old_dressBack08.gif" title="">
<div class="number3"><img src="images/dresses/back/b_2_c.gif" title="">
</div>
</div>
</div>
</TD>
<TD valign="top">
<A HREF="playerDetails.asp?playerID=15964004">Jamie Reay</A>
<A HREF="bookmarks.asp?action=AddConfirm&BookmarkTypeID=2&ObjectID=15964004"><IMG SRC="images/bookmark_16x16.gif" WIDTH="16" HEIGHT="16" BORDER="0" TITLE="Add this player to your bookmarks"></A>
<BR>
TSI = 590 , 29 years, <A HREF="gameRules.asp?find=labels&lt=skillshort&ll=7#skillshort" STYLE="{text-decoration: none; }">solid</A> form<BR>
Has <A HREF="gameRules.asp?find=labels&lt=skill&ll=6#skill" STYLE="{text-decoration: none; }">passable</A> experience and <A HREF="gameRules.asp?find=labels&lt=skillshort&ll=3#skillshort" STYLE="{text-decoration: none; }">poor</A> leadership abilities [Powerful]<BR>
<BR>
</TD></TR></TABLE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD><B>Stamina:</B> </TD><TD><A HREF="gameRules.asp?find=labels&lt=skill&ll=3#skill" STYLE="{text-decoration: none; }">poor</A></TD>
<TD><B> Keeper: </B></TD><TD><A HREF="gameRules.asp?find=labels&lt=skill&ll=2#skill" STYLE="{text-decoration: none; }">wretched</A></TD>
</TR>
<TR>
<TD><B>Playmaking: </B></TD><TD><A HREF="gameRules.asp?find=labels&lt=skill&ll=4#skill" STYLE="{text-decoration: none; }">weak</A></TD>
<TD><B> Passing: </B></TD><TD><A HREF="gameRules.asp?find=labels&lt=skill&ll=3#skill" STYLE="{text-decoration: none; }">poor</A></TD>
</TR>
<TR>
<TD><B>Winger: </B></TD><TD><A HREF="gameRules.asp?find=labels&lt=skill&ll=4#skill" STYLE="{text-decoration: none; }">weak</A></TD>
<TD><B> Defending: </B></TD><TD><A HREF="gameRules.asp?find=labels&lt=skill&ll=5#skill" STYLE="{text-decoration: none; }">inadequate</A></TD>
</TR>
<TR>
<TD><B>Scoring: </B></TD><TD><A HREF="gameRules.asp?find=labels&lt=skill&ll=7#skill" STYLE="{text-decoration: none; }">solid</A></TD>
<TD><B> Set Pieces: </B></TD><TD><A HREF="gameRules.asp?find=labels&lt=skill&ll=2#skill" STYLE="{text-decoration: none; }">wretched</A></TD>
</TR>
</TABLE>