Java) Image crawling (작성중)

북마크 추가

1. jsoup 추가

 

2.

/**
* Created by we on 2017. 1. 24..
*/
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class Main {

public static void main(String[] args) {


}


public void crawler(String domain) extends Thread{
try{


Document doc = Jsoup.connect(domain).get();
Elements img = doc.getElementsByTag("img");
for (Element el : img) {
String src = el.absUrl("src");
System.out.println("Image Found!");
System.out.println("src attribute is : "+src);
}
}catch(Exception e){
System.out.println(e.getMessage());
}
}

}

 

HKH
2017-01-24 16:53
SHARE
댓글
keyboard_arrow_left
keyboard_arrow_up