Building a Bot in java [closed]
I simply want to create an Bot that can run (preferably) on a web-server, and simply 'clicks' on an object of a web page using java.
please refer me to some tutorials that can be of help to meHtmlUnit is a programmable web browser (in Java). See http://htmlunit.sourceforge.net/gettingStarted.html.
I think you can start from Apache Droids project. They have module for web crawling
Since a "click" is basically just a machine requesting a resource, you could do something as simple as:
clickURL = new BufferedReader(new InputStreamReader(new URL(URLOrFilename).openStream()));
This will open the stream. I don't know if you have to actually read anything (e.g. BufferedReader.readLine()
), or if you can immediately close the stream, but that'll do it. Wrap it in a main()
method, and you're done.
You'll need to import the appropriate I/O Java libraries.
精彩评论