Jsoup: how to get an image’s absolute url?

Once you have the image element, e.g.: Element image = document.select(“img”).first(); String url = image.absUrl(“src”); // url = http://www.example.com/images/chicken.jpg Alternatively: String url = image.attr(“abs:src”); Jsoup has a builtin absUrl() method on all nodes to resolve an attribute to an absolute URL, using the base URL of the node (which could be different from the URL … Read more

JSoup UserAgent, how to set it right?

You might try setting the referrer header as well: doc = Jsoup.connect(“https://www.facebook.com/”) .userAgent(“Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6”) .referrer(“http://www.google.com”) .get();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)