jeudi 14 avril 2016

Saving webpage as txt (not the webpage code)

I want to save a webpage as txtfile. I don't want to save the code, I don't want the code at all, I want to save the page itself as txtfile and then I know what I want to do with the txt file.

I use the below code to open the page

import java.awt.Desktop;
import java.net.URI;


public class Main {

public static void main(String[] args) throws Exception {

    Desktop d = Desktop.getDesktop();
    String url = "http://www.google.com";
    d.browse(new URI(url));
}

}

As well I want to make the browse hidden, can it be done?

to make it more clear, to save a page as txt, you press CTRL + S and then choose txt. I don't want the code of the page at all, I tried with buffered reader and input stream but this is not what I need at all because they give me the code of the URL which I don't need. Thank you for your suggestions.




Aucun commentaire:

Enregistrer un commentaire