My question is this: I and my team are developing software that analyzes a table with specific data, but to generate this table we use a website where you enter an information and this website analyzes and generates all the data about this information in a table in html. Most of us have basic and intermediate knowledge of java, so I would like to know if there is a way to make a program that will receive the input, consult that website, enter the past information, collect the result in html and return only this result already soon.
Edit: Here is the part of my code that makes the connection, the site receives a genetic sequence, processes and then returns a table in html. What I want is for my system to connect, send the sequence and capture the response.
package wangConn;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
public class WangConnection {
public static void main(String[] args) {
String param1 = "ATGCCCCCGACGCCCCCGGGGGGTGA", param2="Submit";
URL url;
HttpURLConnection connection = null;
BufferedReader in = null;
DataOutputStream out = null;
try {
// Mounting content to be sent
String data = "seqfield=" + URLEncoder.encode(param1, "UTF-8");
data += "Submit=" + URLEncoder.encode(param2, "UTF-8");
url = new URL("http://wangcomputing.com/assp/");
// Make connection with the specified URL
connection = (HttpURLConnection)url.openConnection();
// Enable writing on URLConnection
connection.setDoOutput(true);
// Connect using the POST method
connection.setRequestMethod("POST");
// Define the requisition type
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
// Send data
out = new DataOutputStream(
connection.getOutputStream());
out.writeBytes(data);
out.flush();
out.close();
// Getting return from the connection
String line;
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
while((line = in.readLine()) != null) {
System.out.println(line);
}
}
catch (MalformedURLException ex) {
System.out.println("Bad format URL: " + ex.getMessage());
}
catch (IOException ex) {
System.out.println("Unable to connect: " + ex.getMessage());
}
finally {
if(out != null) {
try {
out.close();
}
catch (IOException ex) {
System.out.println("Unable to close input stream: " + ex.getMessage());
}
}
if(in != null) {
try {
in.close();
}
catch (IOException ex) {
System.out.println("Unable to close output stream: " + ex.getMessage());
}
}
connection.disconnect();
}
}
}
My problem now is that the website I'm trying to submit form on the website to no avail. The type of input used: