Results 1 to 2 of 2

Thread: Web Broswer Control

  1. #1

    Thread Starter
    Hyperactive Member MikeBAM's Avatar
    Join Date
    Sep 2000
    Location
    Metro Detroit
    Posts
    284

    Question Web Broswer Control

    I'm wondering is there a way using the Web Broswer Control that you could some how get the text on the current page or get the HTML source to the a page. What I'm trying to do is as if it was to scan or search a page. I want to check if a word in text shows up on the page then do something. If you could some how get the text then you could use some like :
    if Instr(SiteTextOrHTML,"KeyWord") then

    Please help...
    ~* )v( ! /< E *~

  2. #2
    Frenzied Member
    Join Date
    Mar 2001
    Location
    You are HERE •™
    Posts
    1,300
    You could always use SendKeys and CTRL+F to display the Find(on this page) dialogue box. Or try something like this:

    VB Code:
    1. Private Sub Form_Load()
    2.     WebBrowser1.Navigate "http://www.yahoo.com"
    3. End Sub
    4.  
    5. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    6.     Dim strFind As String, strHtml As String
    7.     strFind = "Calendar"
    8.    
    9.     If pDisp Is WebBrowser1.Object Then
    10.         strHtml = WebBrowser1.Document.documentelement.innerHTML
    11.             If InStr(strHtml, strFind) Then
    12.                 MsgBox "Word Found"
    13.             End If
    14.     End If
    15.    
    16. 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
  •  



Click Here to Expand Forum to Full Width