Page 1 of 1

Need Help Retrieving Google Search Results

Posted: Mon Dec 27, 2010 9:47 pm
by wungchow
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?

Re: Need Help Retrieving Google Search Results

Posted: Wed Dec 29, 2010 1:39 pm
by Klaus
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

Re: Need Help Retrieving Google Search Results

Posted: Tue Jan 04, 2011 3:31 pm
by AndyP
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.