Hi I am a perl newbie trying to write a script that will go through an array of baskeball teams getting the season points per game average of players on that team if they average greater than 5 points per game.
Here is what I have so far (very limited)
This very simply prints out the team name. The main data I want to get however is from this line. (this is one player from about 13, I only pasted one from the code to keep the post as short as possible).
<tr class="oddrow" align=right><TD align =left>
<a href="/ncb/player/profile?playerId=11225">Craig Smith</a></TD><TD>31</TD><TD>35.4</TD><TD bgcolor=#C1C1C1>17.1</TD><TD>8.7</TD><TD>2.7</TD>
<TD>2.3</TD><TD>1.2/1</TD><TD>1.2</TD><TD>0.8</TD><TD>3.0</TD><TD>.578</TD><TD>.655</TD><TD>.091</TD><td>1.55</TD></tr><tr class="evenrow" align=right>
So basically I need the name and the points per game (which is the td with th bgcolor of #C1C1C1) for each player (if the ppg is greater than 5.
Can someone point me in the right direction?
Thanks
Here is what I have so far (very limited)
Code:
#!C:\perl
use LWP::Simple;
$x=3;
my @teams = (68, 99, 103, 151);
while ($x>=0)
{
$data=get("[URL unfurl="true"]http://sports.espn.go.com/ncb/teamstats?teamId=$teams[/URL][$x]&sort=avgPoints");
if ($data =~ m|<title>ESPN.com: ([^<]*)Teamstats</title>|s)
{
$teamname=$1;
print "$teamname\n";
}
$x--;
}
<tr class="oddrow" align=right><TD align =left>
<a href="/ncb/player/profile?playerId=11225">Craig Smith</a></TD><TD>31</TD><TD>35.4</TD><TD bgcolor=#C1C1C1>17.1</TD><TD>8.7</TD><TD>2.7</TD>
<TD>2.3</TD><TD>1.2/1</TD><TD>1.2</TD><TD>0.8</TD><TD>3.0</TD><TD>.578</TD><TD>.655</TD><TD>.091</TD><td>1.55</TD></tr><tr class="evenrow" align=right>
So basically I need the name and the points per game (which is the td with th bgcolor of #C1C1C1) for each player (if the ppg is greater than 5.
Can someone point me in the right direction?
Thanks