I try to get all divs from the website. If I try it with google.com or another webpage it works fine, just instagram gives an empty result. The metod looks like:
public static List<String> getPhotoPaths(String url) {
List<String> paths = new ArrayList<>();
try {
Document doc = Jsoup.connect("http://ift.tt/1qQJ801")
.userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2")
.get();
for (Element element : doc.select("div")) {
System.out.println(element);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return paths;
}
Has someone an idea whats wrong? This is the test website, it uses normaly divs like every other page. Or not?
Aucun commentaire:
Enregistrer un commentaire