代码
URL url = new URL("http://www.netbian.com/meinv/index_19.htm");
URLConnection conn = url.openConnection();
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line ;
String regex = "http://\\S+small\\S+\\.jpg";
Pattern pattern = Pattern.compile(regex);
while((line = br.readLine() )!= null){
Matcher matcher = pattern.matcher(line);
while(matcher.find()){
System.out.println(matcher.group());
}
}
br.close();
效果
下载到本地
https://blog.csdn.net/zhyaw56zhu/article/details/136115019?spm=1001.2014.3001.5502