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());
}
}

}

 

AD
통관알리미
2017-01-24 16:53
SHARE
댓글