D
Damo
I'm trying to query google using the URL class and appending the query
to the end of the URL :
Its returning no results, Anyone know why: this is what it looks like
public String google(String query)
{
String inputLine=null;
try {
URL google = new URL("http://www.google.com/search?q="+query);
BufferedReader d = new BufferedReader(new
InputStreamReader(google.openStream()));
while ((inputLine = d.readLine()) != null) {
System.out.println(inputLine);
}
d.close();
} catch (MalformedURLException me) {
System.out.println("MalformedURLException: " + me);
} catch (IOException ioe) {
System.out.println("IOException: " + ioe);
}
return inputLine;
}
thanks
to the end of the URL :
Its returning no results, Anyone know why: this is what it looks like
public String google(String query)
{
String inputLine=null;
try {
URL google = new URL("http://www.google.com/search?q="+query);
BufferedReader d = new BufferedReader(new
InputStreamReader(google.openStream()));
while ((inputLine = d.readLine()) != null) {
System.out.println(inputLine);
}
d.close();
} catch (MalformedURLException me) {
System.out.println("MalformedURLException: " + me);
} catch (IOException ioe) {
System.out.println("IOException: " + ioe);
}
return inputLine;
}
thanks