Connection con = Jsoup.connect(urlStr); /* this browseragant thing is important to trick servers into sending us the LARGEST versions of the images */ con.userAgent(Constants.BROWSER_USER_AGENT); Document doc = con.get(); String text = null; Elements metaOgTitle = doc.select("meta[property=og:title]"); if (metaOgTitle!=null) { text = metaOgTitle.attr("content"); } else { text = doc.title(); }
Read full article from jsoup - How to get page meta (title, description, images) like facebook attach url using Regex in java - Stack Overflow
No comments:
Post a Comment