galera tenho o codigo abaixo...
===========================SimpleUserAgentContext uacontext = new SimpleUserAgentContext();
uacontext.setScriptingEnabled(true);
uacontext.setExternalCSSEnabled(false);
DocumentBuilderImpl builder = new DocumentBuilderImpl(uacontext);
URL url = new URL(TEST_URI);
URLConnection con = url.openConnection();
String TEST_URI = "http://www.HORA.com.br"
InputStream in = con.getInputStream();
try {
Reader reader = new InputStreamReader(in, "UTF-8");
InputSourceImpl inputSource = new InputSourceImpl(reader, TEST_URI);
Document d = (Document) builder.parse(inputSource);
HTMLDocumentImpl document = (HTMLDocumentImpl) d;
Element element = document.getElementById("HORA_AGORA");
System.out.println(element.getTextContent());
} finally {
in.close();
}
ela vai em um site...e pega o valor q ta no campo HORA_AGORA...
porem ele so faz issu uma vez,,e na primeira visita do siet o campo "HORA_AGORA = --:--:--", ou seja toda vez q conecto no site o campo tem valor --:--:--, depois de um tempo q comeca a contar a hora ..queria tipo jogar em um FOR e fikar pegando as atualizacoes,,,tipo mostrar a hora do site em meu console...
alguem sabe como fazer?