展开全部
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
public class GetLinks {
private String webSource;
private String url;
public GetLinks(String url) throws MalformedURLException, IOException {
this.url = Complete(url);
webSource = getWebCon(this.url);
}
private String getWebCon(String strURL) throws MalformedURLException,
IOException {
StringBuffer sb = new StringBuffer();
java.net.URL url = new java.net.URL(strURL);
BufferedReader in = new BufferedReader(new InputStreamReader(url
.openStream()));
String line;
while ((line = in.readLine()) != null) {<