Scraping top40.com



<!-- **** jfm: Start of interesting stuff -->

<!-- **** jfm: There are two TR's w/this background color.  The first, i.e. this one, is what we need -->
<Tr bgcolor=F17D38>  

  <td width=15 valign=bottom><font size=1 color=eeeeee>TW</td> 
   <td></td>
   <td valign=bottom><font size=1 color=eeeeee>LW</td>
   <td valign=bottom width=100 style="padding-left: 5px;"><font size=1 color=eeeeee>Video</td>
   <td colspan=5 width=380 align=left><font size=1 color=eeeeee>SONG / ARTIST</td>
   <td valign=bottom align=right><font size=1 color=eeeeee>PP</td>
   <td valign=bottom align=right><font size=1 color=eeeeee>WC</td>
   <td valign=bottom align=right><font size=1 color=eeeeee>TWC</td>
</tr>

<tr  class='latc_song' chid='1'>
   <td align=right><B>1</b></td>  <!-- **** jfm: this week's position -->
   <td><img src=http://maxcdn.top40-charts.com/images/same.gif></td>
   <td align=right bgcolor=C3D9C0><font color=384953>1</font></td>

   <td colspan=4 width=380>

   <table cellpadding=0 cellspacing=0 borer=0>
      <tr>
         <td width=100 height=75 valign=middle align=center class=videolink
             style='background-image:url(http://maxcdn.top40-charts.com/thumb.php?x=100
                                          &i=http://img.youtube.com/vi/450p7goxZqg/0.jpg);'>
            <a href=/songs/media.php?sid=37001 style='padding: 20px;'>
               <img width=30 height=30 src='http://www.top40-charts.com/images/play.png'
                    alt='Watch the video' title='Watch the video' border=0>
            </a>
         </td>

         <td style="padding-left: 10px;">
            <a href=/song.php?sid=37001>
               <img width=75 height=75
                    src="http://maxcdn.top40-charts.com/songs/image.php?size=small&&item=B00E59KZOI" border=0>
            </a>
         </td>
         
         <td style="padding-left: 10px;">
           <div style="margin-bottom: 4px;">

            <!-- **** jfm: anchor tag has text of title and link to song's page -->
            <B><a style="padding-bottom: 1px; text-decoration: none; border-bottom: 2px solid #F17D38; font-size: 11pt;"
                  href=/song.php?sid=37001>All Of Me</a></b>
           </div>
           
            <!-- **** jfm:  anchor tag has text of artist and link to artist's page -->
            <a style="text-decoration: none; " href="/artist.php?aid=5412">John Legend</a></td>

      </tr>
   </table>

   </td>

   <td width=1 align=right nowrap></td>
   <td width=40 align=right nowrap><div class='latc_ring' chid='1' id='latc_ring_1' style='padding: 3px;'>

      <!-- **** jfm: Cound also scan for 'Chart: USA Singles Top 40 Artist:' -->

      <a onClick="recordOutboundLink(
            this, 'Outbound Links', 'Chart: USA Singles Top 40 Artist:John Legend Song: All Of Me');
            return false;"
         href='http://www.ringtonematcher.com/co/ringtonematcher/02/noc.php?sid=TCHTros&artist=John+Legend&song=All+Of+Me'                                                               
         target=_blank>
            <img src=http://maxcdn.top40-charts.com/images/ear_phone/phone_icon_blue_small_trans_left.gif 
                 title="Get it on ringtone" border=0 hspace=3>
      </a></div></td>
      
   <td align=right nowrap bgcolor=C3D9C0>&nbsp;<font color=384953>1</font></td>
   <td align=right nowrap>&nbsp;&nbsp;<font color=384953>12</font></td>
   <td align=right nowrap>&nbsp;<font color=384953>361</font></td>

</tr>
etc...