Controlling Google Chrome using Java

10,592

Solution 1

I doubt if there is a way to control the web browser without knowing or having its APIs. If the web browser you want to control does not provide an API for your java then it is impossible.

If you want to be able to fully control your web browser, you should try to develop plug-in using their APIs, not via JAVA.

If you just want to open a link in your default web browser, try this:

java.awt.Desktop.getDesktop().browse(java.net.URI.create("http://google.com"));

This code opens the url in your default web broswer. I used this to open lots of forum pages because it requires login session from my web browser and saves the pages all at once.

Solution 2

You might be better off using cPanel XML api for what you are trying.

Share:
10,592
sreejith
Author by

sreejith

A Programmer

Updated on June 08, 2022

Comments

  • sreejith
    sreejith almost 2 years

    I was looking for a way to control google chrome or firefox or internet explorer using java.

    Say like I simply call a function passing the URL as the parameter and the page will be loaded.

    I'm writing a java program that I can use to automatically save files on server so that I don't have to login to cpanel and then make it manually, I can use php to do save the file(s) but I need to test how the site design is. But as I'm new to Java I don't have much knowledge of doing things.

    Thanks, Sreejith