Thanks. I got this figured out before your latest reply, Andy. Here's a shortened version of the output. These are some of the ham radio contacts I've made lately:
Quote:

PY2BN Country:BRAZIL
TI2JJP Country:COSTA RICA
LU6FOV Country:ARGENTINA
KI4MJO Country:USA
YV4DYJ Country:VENEZUELA
NP4A Country:USA
ZP6DYA Country:BRAZIL
YO9HP Country:ROMANIA
KB0RGS Country:USA
YU1XA Country:SERBIA
CT3MD Country:PORTUGAL
W1AW Country:USA
KI4MJO Country:USA
GB6MD Country:England - U.K.
WW2SUB Country:USA
NI4BK Country:USA
HB9Z Country:SWITZERLAND
F5BBD Country:FRANCE


I still need to work with it a bit to add the part about stopping when it has read the last line of the file, but this is what I have:
Code:
on 1:sockread:qrz:{  
  if ($sockerr) {    
    echo -a Error.    
    halt  
  }  
  else {    
    sockread %temptext 

    if ($mid(%temptext,41,8) == Country:) {
      var %head = <tr bgcolor="#FFFFFF"><td align="right">
      var %mid = </td><td><b>
      var %end = </b></td></tr>
      %text = %text $+ $chr(32) $+ $remove(%temptext,%head,%mid,%end)
      write "C:\Documents and Settings\Owner\Desktop\hams2.txt" %text
      unset %text
    }
    elseif ($left(%temptext,14) == <title>QRZ.COM) {
      var %head = <title>QRZ.COM
      var %mid = </td><td><b><a href="/callsign/ $+ %call $+ ">
      var %end = </title>
      set %text $remove(%temptext,%head,%end)
    }

  }
  if (%temptext = </html>) {
    %ln = %ln + 1
    set %url   /detail/ $+ $read("C:\Documents and Settings\Owner\Desktop\hams.txt",%ln)
    set %call   $read("C:\Documents and Settings\Owner\Desktop\hams.txt",%ln)
    sockwrite -n $sockname GET %url HTTP/1.1
    sockwrite -n $sockname Host: www.qrz.com $+ $crlf $+ $crlf
  }
}