I need to scrape all data from those sites:
I use JSOUP. And program must scrape all text from site. As you see those sites have different structures. So I should use something common.
I need to scrape all data from those sites:
I use JSOUP. And program must scrape all text from site. As you see those sites have different structures. So I should use something common.
Try this:
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.io.IOException;
public class Sample {
public static void main(String[] args) throws IOException {
System.out.println(getPrivacyNotice("http://www.gameloft.com/privacy-notice/","div.terms"));
System.out.println(getPrivacyNotice("http://outfit7.com/privacy-policy/#","div#main"));
}
public static String getPrivacyNotice(String url, String tag)throws IOException {
Document doc= Jsoup.connect(url).get();
return doc.select(tag).first().text();
}
}