Click to See Complete Forum and Search --> : Process external link results into form


naro
01-26-2003, 01:14 AM
Hi,

I have the following problem: I have a form and I want to automatically fill some form input boxes with informations obtained from external link.

Example:
I want to show number of result found by google. User fill query into input box and press BUTTON. Javascript function attached to this button connects to google with specified query, parses the output html stream from google and shows ALERT with number of found results (regexp parse for "Results 1 - 10 of about 1257." - I want to show the number "1257" to user).


Is this possible???

thank you

khalidali63
01-26-2003, 07:13 AM
showing user the total some number in a popup window,in text field of a form or in an alert message, all are possible,
I am thinking how are you planning to parse the results page broght back to you from google with JavaScript?

khalid

naro
01-26-2003, 07:29 AM
Yes, this is my problem now.

I've create function with code:

mywin = window.open("http://www.google.com?search=some+text", "");

and now I need to get HTML content from "mywin" to some variable and then parse with regular expression.

Finally:
mywin.close();


My question is: How can I get HTML source from some document to variable ? If it is possible, I need multi-browser solution, not MS specific.

thanks

khalidali63
01-26-2003, 07:32 AM
nope you can not do that with JavaScript.
If you know Java then use a jsp page or servlet to read fromth einput stream and parse the html and create a new page to be displayed for the user.

Khalid