This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Experience with Google Java API?  RSS feed

Erwin Heil
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need somebody with experiences with the Java API from Google.
I use the API to get an easy access to the Google Webservice.
Everything works accept the use of GoogleSearchResultElement!
How can I use e.g. getTitle() or getSnippet()? While calling these methods I get no result..
code snippet:
GoogleSearch s = new GoogleSearch();
if (directive.equalsIgnoreCase("Search")){
// Invoking GoogleSearch
GoogleSearchResult r = s.doSearch();
System.out.println("Google Search Results:");
// here it comes...
GoogleSearchResultElement gsre = new GoogleSearchResultElement();
String st = gsre.getTitle();
String sn = gsre.getSnippet();
System.out.println("Title: "+st+" | Snippet: "+sn); //[IS NOT THERE!]
// Output [IS THERE!]
result = r.toString();
cheers, erwin
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!