Example – How to search Google using Java

google_search_img
Following is the sample code for searching the Google and getting some top results.

This example uses jsoup for sending request and parsing the html response.

Dependency

Jsoup dependency can be downloaded from here : http://jsoup.org/download

Example – search Google with the query “java tutorials”

OUTPUT

www.tutorialspoint.com/java/
www.javatpoint.com/java-tutorial
docs.oracle.com/javase/tutorial/
javabeginnerstutorial.com/core-java/
www.udemy.com/java-tutorial/
tutorials.jenkov.com/java/
www.youtube.com/watch%3Fv%3Dr59xYe3Vyks
www.youtube.com/watch%3Fv%3DCfd9DOnuF9w
beginnersbook.com/java-tutorial-for-beginners-with-examples/
www.freejavaguide.com/corejava.htm
www.java2s.com/Tutorial/Java/CatalogJava.htm
www.vogella.com/tutorials/java.html
www.lynda.com/Java-training-tutorials/1077-0.html
courses.coreservlets.com/Course-Materials/java.html
www.learnjavaonline.org/

 

Author of CodeForEach.com . Loves coding and related technologies.
 

www.000webhost.com