你看这个有用吗?
public static void main(String[] args) throws Exception {
URL url = new URL("http://www.baidu.com");
InputStream ins = url.openConnection().getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(ins));
String serverReturnData = reader.readLine();
String allData = "";
while((serverReturnData = reader.readLine()) != null){
allData +=serverReturnData;
}
String regex = "(https?://[-a-z0-9_.:]+[-\\w~`!@#$%^&*()_+=\\|{};:/?,]*)\'";
Matcher m = Pattern.compile(regex).matcher(allData);
while(m.find()){
System.out.println(m.group(1));
}
}