[ dok_dok47 @ 16.04.2009. 12:38 ] @
Kako da iz nekog HTML file ili sa nekog web sajta preuzmem samo tekst i snimim ga u poseban file ???
[ gajo2 @ 16.04.2009. 12:58 ] @
Parsiraj HTML, izbaci tage i to je to
[ nemnesic @ 16.04.2009. 13:51 ] @
Code:

//note - URL do HTML strane
public void download(String note){
        
        
        String src = "";
        try{
            URL grab_url = new URL(note);
            URLConnection url_conn = grab_url.openConnection();
            BufferedReader in = new BufferedReader(new
InputStreamReader(url_conn.getInputStream()));
            String inputLine;


            while ((inputLine = in.readLine()) != null) {
                src += inputLine; //ceo HTML text ti je ovde.
            }
            //close the buffer
            in.close();
            //store the source
        }catch(Exception e){
            e.printStackTrace();
        }
        
    }