| 发表于:2007-08-24 20:33:281楼 得分:0 |
option explicit dim m as long private sub form_load() webbrowser1.navigate "http://ent.163.com/ " timer1.interval = 60000 '一分钟 end sub private sub timer1_timer() if m > = 10 then webbrowser1.refresh m = 0 else m = m + 1 end if end sub private sub webbrowser1_downloadcomplete() dim vtag, vdoc dim allcount, i 'list1.clear set vdoc = webbrowser1.document.all allcount = vdoc.length for i = 0 to allcount - 1 if ucase(vdoc.item(i).tagname) = "a " then '找到url vtag = vdoc.item(i).href if instr(vtag, "http://ent.163.com/07/0824/08/ ") then '检测url中是否含有 "http://ent.163.com/07/0824/08/ " 'list1.additem vdoc.item(i).href '如果有,则添加到list1中 dim ifile as long ifile = freefile open iif(right(app.path, 1) = "\ ", app.path & "list.txt ", app.path & "\list.txt ") for append as #ifile print #ifile, vdoc.item(i).href close #ifile end if end if next i end sub | | |
|