Get data from the Internet with Java

I want to make the following application in Java for my university project I know the core Java I want to know what I should read "specifically" for this project, because the time is short:

It will have an interface to place your query This string will be used as a query to the Internet search engine and find the data with the help of the search engine (the first page we see (this time is the data of my application.:)) I don't want to display data I just want the source code of HTML file or generated web page Does it sound like an ordinary escape interface? I don't know this

But I think this is for the same purpose If so Please guide me to know how to achieve this In any case, please indicate

>Question 1: what should I read? At this point, any direct help is not my intention I want to achieve it myself. > Question 2: connecting to the Internet also requires some JNLP knowledge

For example Just like Google, which we search for, it shows us the links to the website I can see the source code of this generated web page I just want this page of my application to continue working

Editor: I don't want to rely on Google or any specific web server I want to decide through my application See also my question 2

I found that we have the terms and conditions of the website, and I should try to make my crawler Then my application will not violate the rules That's important to me

Solution

Ashish,

>Learn the basics of JSON from these links (introduction, lib download) > and then check the Google Web search JSON API here. > Learn how to use the httpclient library here to get data from the server. > What you need to do now is to trigger the get request of the search, read the JSON response, use #1 the JSON Lib in to parse the response, and then you have the search results. > Most search engines (Bing, etc.) provide Jason / rest APIs, so you can do the same for other search engines

Note: Jason API usually uses javascritps on the UI side, but because it is very easy and fast to learn, I suggest you do so You can also explore (if time permits) XML based APIs

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>