Interaction with external application
Hi all, this is my first post...I'm sorry that I'm writing in the wrong place but I haven't find a better place.
Now: I'm programming with Java from one year and I have studied the basis and graphical java but I'm not able to make my program communicate with other things...
So my question is:
is it possible that a java program write (for example) in the search box (of google) something? and then click on the first (or second or whatever we want ) link ?
I mean that I'm trying to build a simple program that for example (given by the user the word "JAVA") goes to google page and write in the search box "JAVA" and then choose a link .
I hope that you have understood my question...
for more information don't hesitate and post question...
By by...
Re: Interaction with external application
Possibly not directly (that I know of). What you could do is have the program do the google search using a URL and URLConnection, parse the results, and choose a link that way. Then use the Desktop class to open up that particular link with the default browser. See How to graph html source of website url for more info on making the URLConnection
Re: Interaction with external application
The Robot class can position the cursor on the screen and type there and move the cursor and click.
However it can't easily see what is at the locations it moves the cursor to. If the page in the browser's window can be kept to the same location on the screen, Robot might work.
Re: Interaction with external application
Copeg's suggestion is good, but I'd suggest not hitting Google in that way as non-browser access is against their terms of use. No, I don't have a reference for that but you could search Google ;)
db
Re: Interaction with external application
Quote:
Originally Posted by
Darryl.Burke
Copeg's suggestion is good, but I'd suggest not hitting Google in that way as non-browser access is against their terms of use. No, I don't have a reference for that but you could search Google ;)
db
Thanks for the clarification DB. I had the some hesitation when posting that reply due to the terms of use, but in my haste neglected to mention them
Re: Interaction with external application
Quote:
Originally Posted by
copeg
Thanks for the clarification DB. I had the some hesitation when posting that reply due to the terms of use, but in my haste neglected to mention them
If you spoof the connection to look like a browser, they will never know :cool:
Re: Interaction with external application
Re: Interaction with external application
You know that you can get an imacro add-on for Firefox.
Re: Interaction with external application
Hi all...
Thanks a lot for the replies... I think that I'm gonna to read about robot class...
by by...