Page 1 of 1

automate web browsing

Posted: Wed Oct 14, 2009 5:22 pm
by ascribe
Hi

Is there a way to automatically from a Jade application to bring up the web brower with google webpage for example, fill out the text box then click the Goolge Seach button?

I can display the page in default web browser by using command call _shellExecute (0, "open", "http://www.google.com", 0, 0, 1); but don't know how to automate the rest.

Any help much appreciated

Re: automate web browsing

Posted: Wed Oct 14, 2009 10:26 pm
by allistar
For Google the format of a query is:

http://www.google.co.nz/search?hl=en&rl ... meta=lr%3D

That is for the query "query text here"

Re: automate web browsing

Posted: Thu Oct 15, 2009 10:18 am
by ascribe
Thanks, but I forgot to mention I want to use Post request or something similar. Because it will be used for logging in a web service I don't want query text in this case user name and password to be displayed in the URL.

Re: automate web browsing

Posted: Thu Oct 15, 2009 4:25 pm
by BeeJay
If you have CardSchema in your system, you could utilise the CnHttp class to help do HTTP POST messages to a Web Page.

This is the technique that I used when converting the old Newsgroup postings onto these new forums, including logging onto the forums as the ConvertFromOldNGs user before being able to post the new messages etc.

Cheers,
BeeJay.

Re: automate web browsing

Posted: Fri Oct 16, 2009 9:51 am
by allistar
From what I understand of the original query, the requirement is for a web browser to be opened, fields filled in and then a button on the page clicked. If you are in control of the web server (i.e. you can add a new file to it), then you could make a new page (in php or asp or whatever scripting language is installed) and pass that any relevant parameters using shell execute, and have that simulate the POST using javascript. That'll only work though if you can put this new file on the web server.

Re: automate web browsing

Posted: Fri Oct 16, 2009 11:19 am
by ascribe
Thanks guys, I'll give both methods a go

Re: automate web browsing

Posted: Mon Oct 19, 2009 9:48 am
by torrie
You could also try importing the Web Browser active X control and use the methods available to open the relevant web page etc. (Note that this uses Internet Explorer not the user's preferred browser) see http://msdn.microsoft.com/en-us/library ... S.85).aspx for the details of methods etc that are available.

Re: automate web browsing

Posted: Tue Oct 20, 2009 1:09 pm
by ascribe
You could also try importing the Web Browser active X control and use the methods available to open the relevant web page etc. (Note that this uses Internet Explorer not the user's preferred browser) see http://msdn.microsoft.com/en-us/library ... S.85).aspx for the details of methods etc that are available.
Do you know any activeX or Com can do such thing and also support cross browser?

Re: automate web browsing

Posted: Tue Oct 20, 2009 1:37 pm
by torrie
I'm not aware of an active X that will work across different browsers. However there is an active X control that has been developed for Firefox which has the same methods etc as the Microsoft Web Browser cotrol. http://www.iol.ie/~locka/mozilla/control.htm. I haven't used it so couldn't comment on how it would work.

We use the Web Browser control embedded into a Jade form to display HTML pages that we generate from our application and users are not aware that IE is being used.