Results 1 to 4 of 4

Thread: Search webpage for a word or phrase?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    22

    Resolved Search webpage for a word or phrase?

    Hey everyone!
    I have a simple question, and I hope it has a simple answer

    Here is the code I have so far:
    Code:
    If browser.LocationURL = "www.anysite.com" Then
    This works fine, but instead of checking the location, I want it to check if the webpage has the word "blah" in it. I thought maybe checking browser.document or something, but I couldn't figure out how to do it.

    Thanks!
    Last edited by bowiz2; Feb 9th, 2011 at 01:52 PM.

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Search webpage for a word or phrase?

    You might look at this article and just search the resulting string with InStr.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    22

    Re: Search webpage for a word or phrase?

    Quote Originally Posted by jemidiah View Post
    You might look at this article and just search the resulting string with InStr.
    Thanks! But I'm not great with strings-how can I implement InStr into an If statement?

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    22

    Re: Search webpage for a word or phrase?

    Nevermind, I have answered my own question!

    Code:
    If InStr(text, "blah") = 0 Then
    Changing to answerd!

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