Parsing Google's search results

D

dlhurwitz

I would like to create a simple Javascript page which has a single
searchbox. After the user enters a search in the form, it should
transfer the search to Google and return the search results (the
entire page) into a string.

Then I want to parse the string and extract just the links, and
redisplay them in a simple list on my page. How can I do this keeping
the Google result page hidden, yet parsing in run-time and displaying
the URLs immediately on my own page?

Appreciatively,
~Daniel
 
B

Bart Van der Donck

I would like to create a simple Javascript page which has a single
searchbox. After the user enters a search in the form, it should
transfer the search to Google and return the search results (the
entire page) into a string.

Then I want to parse the string and extract just the links, and
redisplay them in a simple list on my page. How can I do this keeping
the Google result page hidden, yet parsing in run-time and displaying
the URLs immediately on my own page?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Show links in a URI</title>
</head>
<body>
<iframe name="ifr" style="display: none"></iframe>
<script type="text/javascript"
src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://
www.google.com)">
</script>
<script type="text/javascript">
frames['ifr'].document.write(ACD.responseText);
for (var i=0; i<frames['ifr'].document.links.length; i++) {
document.write(frames['ifr'].document.links+'<hr>');
}
</script>
</body>
</html>

Spielerei though. Conrad's suggestion is better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top