java - How to fetch the logo of any website in android? -
i working on project in input url , output website logo. there websites facebook,youtube, yahoo etc uses css make logo attractive, how can fetch logo of these websites. have written following code fetch logo of websites uses logo image :
elements elements = doc.getelementsbytag("img"); (element element : elements) { //searching src tag inside img tag logo =element.attr("src"); string logo1=logo; //if src link has substring logo if(logo1.tolowercase().contains("logo")|| element.attr("alt").tolowercase().contains("logo")) { if(!logo.contains("http")) { if(!logo.startswith("/")) logo=link + "/"+logo; else logo=link+logo; } system.out.println(logo); logoflag=1; } }
Comments
Post a Comment