If the question arises: "How do I get the code to work again?" It would be difficult for everyone to find out what the old page looked like if they did not keep a copy.
I broke your choice, like this one, and it worked for me.
String string = google + URLEncoder.encode(search , charset) + news; Document document = Jsoup.connect(string).userAgent(userAgent).get(); Elements links = document.select( ".r>a");
The current page source looks like
<div class="g"> <table> <tbody> <tr> <td valign="top" style="width:516px"><h3 class="r"><a href="/url?q=https://www.bleepingcomputer.com/news/security/marlboro-ransomware-defeated-in-one-day/&sa=U&ved=0ahUKEwis77iq7cDRAhXI7IMKHUAoDs0QqQIIFCgAMAE&usg=AFQjCNFFx-sJdU814auBfquRYSsct2c8WA">Marlboro Ransomware Defeated in One Day</a></h3>
Results: Title: Marlboro Ransomware won in one day URL: https://www.bleepingcomputer.com/news/security/marlboro-ransomware-defeated-in-one-day/
Title: Qaru offers new opportunities for developers URL: https://techcrunch.com/2016/10/11/stack-overflow-puts-a-new-spin-on-resumes-for-developers/
Edited - Time Range These URL options look awful.
Add suffix & tbs = cdr% 3A1% 2Ccd_min% 3A5% 2F30% 2F2016% 2Ccd_max% 3A6% 2F30% 2F2016
But this part of "min% 3A5% 2F30% 2F2016" contains your minimum date. 5 30 2016. min% 3A + (month of the year) +% 2F + (day of the month) +% 2F + year And in "max% 3A6% 2F30% 2F2016" is your maximum date. 6 30 2016. max% 3A + (month of the year) +% 2F + (day of the month) +% 2F + year
Here is the full Mindy Kaling search URL between 05/30/2016 and 06/30/2016 https://www.google.com/search?tbm=nws&q=mindy%20kaling&tbs=cdr%3A1%2Ccd_min%3A5%2F30%2F2016% 2Ccd_max% 3A6% 2F30% 2F2016
source share