'Having problems with jsoup
I'm trying to get an image by searching in google for this i'm using jsoup, and everything is fine, i can get the images, but they're in a very low quality, there is another way to get them with better quality?
public class JsoupTest {
public static void main(String[] args) {
String userAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36";
String url = "https://www.google.com/search?site=imghp&tbm=isch&source=hp&q=galan de noche planta&gws_rd=cr";
List<String> resultUrls = new ArrayList();
try {
Document doc = Jsoup.connect(url).userAgent(userAgent).referrer("https://www.google.com/").get();
Elements elements = doc.getElementsByTag("img");
for (Element element : elements) {
resultUrls.add(element.absUrl("src"));
}
resultUrls.forEach(System.out::println);
} catch (IOException e) {
e.printStackTrace();
}
}
}
Solution 1:[1]
There is no way to do that.
Google image search used to show the images, but copyright law caused some issues with this; hence they now only host postage stamp sized versions of it, and you have to click through to the site. Trying to find the same image on the target site is very difficult and would involve spidering the entire site, fetching all images, and figuring out which one looks like the postage stamp.
Solution 2:[2]
If I understand correctly, you would like tthe search query you need to introduce in order to find messages sent after a given date. If so, you can find the specific query in the official documentation. You can also list all the Label Ids for a specific user using the following method.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | rzwitserloot |
| Solution 2 | Fernando Lara |
