You have to pass the hidden elements of the form so that when you do POST you get the correct query.
import java.io.IOException;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class Parser {
public static void main(String[] args) throws IOException {
Connection.Response loginForm = Jsoup.connect("http://www.votoinformado.pe/voto/miembro_mesa.aspx")
.method(Connection.Method.GET)
.execute();
Document doc = Jsoup.parse(loginForm.body());
Elements tag = doc.select("input[name=__VIEWSTATE]");
String viestate = tag.attr("value");
tag = doc.select("input[name=__VIEWSTATEGENERATOR]");
String viewstategerator = tag.attr("value");
tag = doc.select("input[name=__EVENTVALIDATION]");
String eventvalidation = tag.attr("value");
Document finalDoc = Jsoup.connect("http://www.votoinformado.pe/voto/miembro_mesa.aspx")
.data("txtCongrDNI", "75624412")
.data("__LASTFOCUS", "")
.data("__EVENTTARGET", "btnCongrDNI")
.data("__EVENTARGUMENT", "")
.data("__VIEWSTATE", viestate)
.data("__VIEWSTATEGENERATOR", viewstategerator)
.data("__EVENTVALIDATION", eventvalidation)
.userAgent("Mozilla")
.post();
String DNI = finalDoc.select("span#lblDNI").text();
String fullName = finalDoc.select("span#lblNombres").text();
System.out.println("The ID number is "+DNI);
System.out.println("The full name is "+fullName);
}
}