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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to get website data

Status
Not open for further replies.

logx

Technical User
Jul 24, 2006
14
RS
Hi,

I am trying to extract certain information from a website, possibly using ServerXMLHTTP.

However, data is presented only after you click a link (initiate a javascript function). The script which pulls this info is not accessible remotely.

How could I trigger that javascript function remotely, via ASP?

Thanks
 
You can't

ASP is server side, javascript is client side.

The only thing you can do is to use the onload event attached to the body element to fire a javascript function as the page loads.


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
 
you can try something like this. this code launches google with a search string, then looks for certain info on the google page. if it's found, then sends a msg.
Code:
search_string = inputbox ("Enter Search String" , "Search Engine First Page", "your search string") 
Set objIE = CreateObject("InternetExplorer.Application")
objIE.navigate "[URL unfurl="true"]http://www.google.com/#hl=en&q=password+removal+service&btnG=Google+Search"[/URL] 
Do While objIE.Busy
   WScript.Sleep 500
Loop
Results = objIE.Document.Body.InnerHTML
If InStr(1,Results,search_string) Then
   msgbox "Found your search string on first search page"
Else
   msgbox "your search string was not found on first page"
End If
 
Your search url is incorrect

Code:
[URL unfurl="true"]http://www.google.com/webhp?q=search+phrase[/URL]

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top