BufferedReader in = new BufferedReader(new InputStreamReader(erstellteURLConnection.getInputStream()));
String line;
String htmlInhalt ="";
while ((line = in.readLine()) != null) {
htmlInhalt += line;
}
//System.out.println(htmlInhalt);
//rules,hosts und ports
String rule = "";
String inputRule = "input name=\"rule";
String host = "";
String inputHost = "input name=\"host";
String port = "";
String inputPort = "input name=\"port";
String value = "value=\"";
String proxys = "";
int i = 0;
int valueStart = 0;
int valueEnde = 0;
int posImString = 0;
int htmlInhaltLange = htmlInhalt.length();
//while(posImString <= htmlInhaltLange){
while(posImString != -1){
//inputFeld rule finden
valueStart = valueStart + htmlInhalt.substring(valueStart).indexOf(inputRule);
//value aus dem inputFeld rule finden
valueStart += htmlInhalt.substring(valueStart).indexOf(value);
//zum Wert von value springen
valueStart = valueStart+value.length();
//Ende des Werts bestimmen
valueEnde = valueStart + htmlInhalt.substring(valueStart, htmlInhaltLange).indexOf("\"");
System.out.println("rule"+ i +": " + htmlInhalt.substring(valueStart, valueEnde));
//inputFeld host finden
valueStart = valueStart + htmlInhalt.substring(valueStart).indexOf(inputHost);
//value aus dem inputFeld host finden
valueStart += htmlInhalt.substring(valueStart).indexOf(value);
//zum Wert von value springen
valueStart = valueStart+value.length();
//Ende des Werts bestimmen
valueEnde = valueStart + htmlInhalt.substring(valueStart, htmlInhaltLange).indexOf("\"");
System.out.println("host"+ i +": " + htmlInhalt.substring(valueStart, valueEnde));
//inputFeld port finden
valueStart = valueStart + htmlInhalt.substring(valueStart).indexOf(inputPort);
//value aus dem inputFeld host finden
valueStart += htmlInhalt.substring(valueStart).indexOf(value);
//zum Wert von value springen
valueStart = valueStart+value.length();
//Ende des Werts bestimmen
valueEnde = valueStart + htmlInhalt.substring(valueStart, htmlInhaltLange).indexOf("\"");
System.out.println("port"+ i +": " + htmlInhalt.substring(valueStart, valueEnde));
//proxys +="&rule"+i+"="+rule+"&host"+i+"="+host+"&port"+i+"="+host;
i++;
posImString = htmlInhalt.substring(valueStart).indexOf(inputRule);
}
System.out.println("ENDE der WhileSchleife");