|
-
Apr 4th, 2001, 08:02 PM
#1
Thread Starter
PowerPoster
o.k i know i posted this yesterday! And this is mainly for geoff_xrx or bloodeye or anyone else who reckons they got an answer!
The code below is suposed to search a particular web sites and find the words a specify in the code.
But when run it, it goes to the site fine and lists the url name countless times until i get an error. The thing is it does this even when there are no matching results! why?
I'm using the web browser control!
Option Compare Text
Dim site(2) As String
Dim words(2) As String 'just a few words....you'll have to add them all
Dim siteNum As Integer
Private Sub Form_Load()
Web1.Navigate "http://www.riu.com.au"
site(0) = "http://www.riu.com.au"
words(0) = "Resource Service Group"
siteNum = 0
End Sub
Private Sub nextSite()
Web1.Navigate site(siteNum)
Do Until Web1.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
siteNum = siteNum + 1
End Sub
Private Sub web1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim itext As String
Dim x As Integer
Me.Caption = "site:" & siteNum & " " & URL
If (pDisp Is Web1.object) Then
itext = Web1.Document.documentElement.innerText
For x = 0 To UBound(words)
If InStr(itext, words(x)) < 0 Then
List1.AddItem Web1.LocationURL
nextSite
Exit Sub
End If
Next x
nextSite
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|