Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21271

Searching page accordingly sending data

$
0
0
I'm opening a page in webbrowser and searching commands with this method
Quote:

Originally Posted by wiz126 View Post
VB Code:
  1. Private Sub Command1_Click()
  2.     Dim strfindword As String
  3.         strfindword = InputBox("What are you looking for?", "Find", "") ' what word to find?
  4.             If WebPageContains(strfindword) = True Then 'check if the word is in page
  5.                 MsgBox "The webpage contains the text" 'string is in page
  6.             Else
  7.                 MsgBox "The webpage doesn't contains the text" 'string is not in page
  8.             End If
  9. End Sub
  10. Private Function WebPageContains(ByVal s As String) As Boolean
  11.     Dim i As Long, EHTML
  12.     For i = 1 To WebBrowser1.Document.All.length
  13.         Set EHTML = _
  14.         WebBrowser1.Document.All.Item(i)
  15.  
  16.  
  17.         If Not (EHTML Is Nothing) Then
  18.             If InStr(1, EHTML.innerHTML, _
  19.             s, vbTextCompare) > 0 Then
  20.             WebPageContains = True
  21.             Exit Function
  22.         End If
  23.     End If
  24. Next i
  25. End Function
  26. Private Sub Form_Load()
  27.     WebBrowser1.Navigate2 "www.msn.com"
  28. End Sub

It is dynamic window(chatbox) everybody is typing something, I want to send auto reply like if someone types "hey" program shall send text but problem is this searching method I can't send auto reply for once cuz it is seeing always the "hey" text there and trying to send reply continuously. I want to make it for once everytime its been written.
Example:
1:hey
app: hey bro
2:bla
3:hey
app:hey bro

So I want to know another methods,your ideas,examples...
messages are in <dd></dd> ;

Viewing all articles
Browse latest Browse all 21271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>