Click here to Skip to main content
13,253,507 members (56,539 online)
   

Java

 
AnswerRe: help me please Pin
Richard MacCutchan13-Jan-13 23:23
mvpRichard MacCutchan13-Jan-13 23:23 
AnswerRe: help me please Pin
Avidwan14-Jan-13 5:41
memberAvidwan14-Jan-13 5:41 
GeneralRe: help me please Pin
Richard MacCutchan14-Jan-13 7:22
mvpRichard MacCutchan14-Jan-13 7:22 
GeneralRe: help me please Pin
cubocik16-Jan-13 1:40
membercubocik16-Jan-13 1:40 
QuestionWebpage saver -- help Pin
cubocik13-Jan-13 8:38
membercubocik13-Jan-13 8:38 
SuggestionRe: Webpage saver -- help Pin
Richard MacCutchan13-Jan-13 23:18
mvpRichard MacCutchan13-Jan-13 23:18 
GeneralRe: Webpage saver -- help Pin
cubocik14-Jan-13 6:51
membercubocik14-Jan-13 6:51 
GeneralRe: Webpage saver -- help Pin
Richard MacCutchan14-Jan-13 7:12
mvpRichard MacCutchan14-Jan-13 7:12 
You are missing a few #import statements, and you are also trying to read from your output stream. Try this:
import java.io.*;
import java.net.*;
 
public class webpagesaver{
    public static void main(String[] args) throws IOException{
    
        String saveFile = "PaginaCopiada.html"; //name of SaveFile
        String location = "http://www.sapo.pt"; // website url withou #
        URL url = new URL(location);
        URLConnection conn = url.openConnection();
        InputStream is = conn.getInputStream();
        conn.connect();
        BufferedWriter out = new BufferedWriter(new FileWriter(saveFile));
        BufferedReader in = new BufferedReader(new InputStreamReader(is));
        String l = in.readLine();
        while(l!=null){
            out.write(l);
            out.newLine();
        }
        in.close();
        out.close();
    }    
}

One of these days I'm going to think of a really clever signature.

GeneralRe: Webpage saver -- help Pin
cubocik14-Jan-13 7:34
membercubocik14-Jan-13 7:34 
GeneralRe: Webpage saver -- help Pin
cubocik14-Jan-13 7:39
membercubocik14-Jan-13 7:39 
GeneralRe: Webpage saver -- help Pin
Richard MacCutchan14-Jan-13 7:55
mvpRichard MacCutchan14-Jan-13 7:55 
GeneralRe: Webpage saver -- help Pin
cubocik14-Jan-13 8:55
membercubocik14-Jan-13 8:55 
GeneralRe: Webpage saver -- help Pin
Richard MacCutchan14-Jan-13 23:02
mvpRichard MacCutchan14-Jan-13 23:02 
GeneralRe: Webpage saver -- help Pin
cubocik16-Jan-13 1:38
membercubocik16-Jan-13 1:38 
GeneralRe: Webpage saver -- help Pin
Richard MacCutchan16-Jan-13 1:51
mvpRichard MacCutchan16-Jan-13 1:51 
QuestionHow to Record Audio at client Side? Pin
Mrugrajsinh13-Jan-13 8:19
memberMrugrajsinh13-Jan-13 8:19 
Questioncode error Pin
Member 975139812-Jan-13 13:47
memberMember 975139812-Jan-13 13:47 
AnswerRe: code error Pin
Richard MacCutchan13-Jan-13 0:35
mvpRichard MacCutchan13-Jan-13 0:35 
QuestionRegarding Maven and Jenkins Pin
sivaKrishna joga2-Jan-13 23:47
membersivaKrishna joga2-Jan-13 23:47 
AnswerRe: Regarding Maven and Jenkins Pin
Richard MacCutchan3-Jan-13 1:12
mvpRichard MacCutchan3-Jan-13 1:12 
GeneralRe: Regarding Maven and Jenkins Pin
sivaKrishna joga3-Jan-13 1:23
membersivaKrishna joga3-Jan-13 1:23 
GeneralRe: Regarding Maven and Jenkins Pin
Richard MacCutchan3-Jan-13 2:06
mvpRichard MacCutchan3-Jan-13 2:06 
GeneralRe: Regarding Maven and Jenkins Pin
sivaKrishna joga3-Jan-13 2:13
membersivaKrishna joga3-Jan-13 2:13 
GeneralRe: Regarding Maven and Jenkins Pin
Richard MacCutchan3-Jan-13 2:58
mvpRichard MacCutchan3-Jan-13 2:58 
GeneralRe: Regarding Maven and Jenkins Pin
sivaKrishna joga3-Jan-13 3:16
membersivaKrishna joga3-Jan-13 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy |
Web03 | 2.8.171114.1 | Last Updated 21 Nov 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid