I need a Java library for doing web searches ( any search engine is good ). I should be able to to write 开发者_StackOverflowcode such as:
WebSearch search = new WebSearch("Apple");
System.Out.Println("Results = " + search.Results.Count);
Does such a library/API exist ?
Regards, Sebastian
There's an API called JFreeWebSearch: http://www.ke.tu-darmstadt.de/resources/jfreewebsearch
I think this is your best options.
What is important here is Google's API:
http://ajax.googleapis.com/ajax/services/search/web?start=0&rsz=large&v=1.0&q=Apple
Note the "Apple" in the query String.
With this in mind, use any Java HttpClient (URLConnection class, Apache's HttpClient, you name it) to query and get results back.
lucene is Java based search engine
精彩评论