问题
I need to extract search results from Bing. Is there any available Java code to achieve this ?
回答1:
This MSDN forum thread has alot of answers and examples.
Also, when you buy or subscribe to a dataset on Azure, they have a java example. Here's an example
Go to the odata4j site and download the latest release.
Add odata4j-clientbundle-x.x.jar to your Java build path.
You can use the following code to call the service.
ODataConsumer c = ODataConsumers
.newBuilder("https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/")
.setClientBehaviors(OClientBehaviors.basicAuth("accountKey", "{your account key here}"))
.build();
OQueryRequest<OEntity> oRequest = c.getEntities("Web")
.custom("Query", "stackoverflow bing api");
Enumerable<OEntity> entities = oRequest.execute();
来源:https://stackoverflow.com/questions/12648847/how-to-use-bing-search-api-in-java