Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

monitor a listing on a search engine - possible? 1

Status
Not open for further replies.

wvdba

IS-IT--Management
Jun 3, 2008
465
US
hi,
i have been asked by a client to monitor different search engines to see if their website shows up on the first page of the result. i'm somewhat familiar with vbscript. here's what they want:
they want to monitor to see if their website shows up on the first page of the search engine by typing a phrase every 10 minutes to see if they show up on the first page of that engine or not.
example: the website name is the phrase: tankless water heater
is there any way that this can be done?
thanks.
 
1) You can launch IE as
Code:
Set objIE = CreateObject("internetexplorer.application")
objIE.visible = True
objIE.navigate "[URL unfurl="true"]http://www.google.com"[/URL]

2) Using sendkeys, you can put the phrases in and hit return.

3) setTimer can be used to kick it off every 10 minutes.

The only problem is reading what the search engine displays. It is probably some sendkey stuff to either dump the source of the page or somehow activate the page search in IE. Problem is I don't know what it returns if it cannot find the text.
 
thanks xwb,
i'm familiar with sendkey feature. let's say that i go to google page.
how do fill out the search string?
after i fill out the search string, i sendkey "enter"?
then sendkey alt+E and shift+f to open up find dialog
how do i enter find "string"?
thanks.
 
Use IE. You can then look at InnerHTML to see if the text you want is present.

here is sample code that uses Google to search for my domain The Spider's Parlor.

Code:
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("[URL unfurl="true"]http://www.google.com/search?hl=en&q=spiders+parlor")[/URL]
Do While objIE.Busy
   WScript.Sleep 500
Loop
Results = objIE.Document.Body.InnerHTML

If InStr(1,Results,"[URL unfurl="true"]www.thespidersparlor.com")[/URL] Then
	WScript.Echo "Found it on first search page"
Else
	WScript.Echo "Time to advertise some more"
End If

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
thanks mark!
that was great suggestion. i was coding some funky sendkey stuff and so on. i'm going to try this code of yours right now.
thanks a bunch.
 
mark,
thanks.
it worked perfectly. without opening I.E. i tested with something that was on first page and something that wasn't on first page. so, it WORKS.
thanks again. you deserve a STAR.
cheers.
 
Happy to be of service.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top