Results 1 to 7 of 7

Thread: searching web pages in vb

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849

    Question searching web pages in vb

    hello,
    I have a phrase in Text1 and an url in Text2.
    my question is, how do I search for a phrase in a web page to
    see if it's in it or not using vb?

    thanks
    Dekel C.

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    im assuming you are using the webbrowser control...

    VB Code:
    1. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    2. If (pDisp Is WebBrowser1.Application) Then
    3.     Doc = WebBrowser1.Document.documentelement.innertext
    4.     If InStr(Doc, Text2.Text) Then
    5.         MsgBox "its there!"
    6.     End If
    7. End If
    8. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    what type of variable is Doc?
    Dekel C.

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    sorry..

    Dim Doc as String
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    I have a list of pages to search. if i open each one and search
    in them for a phrace it will take me a long time until I'm done...
    is there a fatest way to do that?
    Dekel C.

  6. #6
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    not really...

    you need to either download them...or "browse" to each one...
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Location
    I'm right here!
    Posts
    849
    ok, thanks [LGS]Static.

    but there is a problem with the above code...
    if I enter the phrase "<html>" it will also find it...
    what I want to search is the web page...

    any other suggestions?

    Dekel C.

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