Does anyone know how I can scan a webpage for certain words?
Printable View
Does anyone know how I can scan a webpage for certain words?
Well sort of it's pretty difficult with frames and the like!
Bloodeye and SD helped me with something similar!
Try something like this:
Option Compare Text
Dim site(2) As String
Dim words(3) As String
Dim siteNum As Integer
Private Sub Form_Load()
Web1.Navigate "http://www.riu.com.au/gold/secure/v5i34/contents.htm"
site(0) = "http://www.riu.com.au/gold/secure/v5i34/contents.htm"
site(1) = "http://www.mining-journal.com/emailsub.htm"
words(0) = "Resource Service Group"
words(1) = "RSG"
words(2) = "received"
words(3) = "gabriel"
siteNum = 0
End Sub
Private Sub web1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
Dim itext As String
Dim x As Integer
Me.Caption = "site:" & siteNum & " " & URL
If (pDisp = Web1.object) Then
itext = Web1.Document.documentElement.outerText
For x = 0 To UBound(words)
If InStr(itext, words(x)) <> 0 Then List1.AddItem Web1.LocationURL
Next x
MsgBox "no records"
End If
If siteNum = -1 Then
Exit Sub
End
End If
nextSite
End Sub
Private Sub nextSite()
Web1.Navigate site(siteNum + 1)
siteNum = -1
End Sub
I want to scan another browser, such as IE.
Umm that uses the internet control which is IE!
thats what web1 is!
But you want to scan another application?????
I realize that, I want to use the REAL IE, not a custom browser. Whenever a user is surfing in the REAL stand alone IE, I want to scan for certain words in the page he/she's on.
Perhaps the will help you then:
here
I'm sure you can alter it to suit you!
If not pm mathew!