Find Command in revBrowser

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Find Command in revBrowser

Post by lohill » Sun Aug 28, 2011 6:59 pm

There does not appear to be a revBrowserFind command but I have a situation where I would like to use one or the equivalent of one. The find command works very well to find things in fields and also seems to work very well in DataGrids. On a card which is basically made up of a revBrowser instance the find command returns 'not found'. If I am just in Explorer and looking at the web site a 'Find' seems to work just fine. Is there a way to implement that 'Find' while I am in Live Code with a revBrowser instance as the place where I want to find something?

Any suggestions for workarounds will be appreciated.

Regards,
Larry

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Find Command in revBrowser

Post by Mark » Sun Aug 28, 2011 10:27 pm

Hi Larry,

Get the htmlText of the browser object, find all instances of a string, change the htmlText to mark all these intances yellow, and set the htmlText of the browser object to the modified htmlText.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Find Command in revBrowser

Post by lohill » Mon Aug 29, 2011 12:23 am

Mark,
Get the htmlText of the browser object, find all instances of a string, change the htmlText to mark all these intances yellow, and set the htmlText of the browser object to the modified htmlText.
Unfortunately I am dealing with a web page that differs from the norm. This is all I get with a 'put revBrowserGet(1,"htmlText")':

<HTML><HEAD></HEAD>
<BODY><IMG src="http://admin.petfinder.com/pfadmin/a4j/ ... ODY></HTML>

If I 'View/Source' while in Explorer I can see all sorts of stuff but I cant seem to get revBrowser to give me the htmlText. In other parts of my program the only way I have been able to deal with the data on this web page is to select it all and copy it to the clipboard. Then using clipboardData I have been able to parse out the things I need to work with. This is not too elegant but has worked. I don't think this method would work for a Find though.

Do you have any other suggestions?

Larry

Post Reply