Need Help Retrieving Google Search Results

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
wungchow
Posts: 1
Joined: Mon Dec 27, 2010 9:46 pm

Need Help Retrieving Google Search Results

Post by wungchow » Mon Dec 27, 2010 9:47 pm

Hi all,

I'm a long time Rev/HyperCard user but I'm new to the Internet functionality. Specifically, I'm trying to retrieve the # of search results that Google displays when you do a search.

The number of interest is contained in the source as shown:

<div id="resultStats">About 233,000 results<nobr> (0.30 seconds)&nbsp;</nobr></div>

however, when I retrieve the HTML source of the page it's not there. So I'm guessing it's XML? Can anyone shed some light on how I can get that number?

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Need Help Retrieving Google Search Results

Post by Klaus » Wed Dec 29, 2010 1:39 pm

Ni hao Chow (presumed you are chinese :)),

unfortunately LiveCode only supports a very small subset of HTML like basic font tags etc.

So more complex HTML (especially with CSS) is not supported and thus "the htmltext" will not
work you you in this case!

You will need to parse the bare HTML manually and extract whatever you need.
If you are familiar with RegEx (I'm not), then this may help you.

Sorry for the bad news!


Best from germany

Klaus

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: Need Help Retrieving Google Search Results

Post by AndyP » Tue Jan 04, 2011 3:31 pm

Hi Wungchow,

Try this:

set the HTMLtext of fld "YOURFIELD" to URL "http://www.google.co.uk/search?q=livecode"

Using the HTMLtext picks up the number of searches.
Andy .... LC CLASSIC ROCKS!

Post Reply