1. The address of the search term is obtained using the simulated address method (such as Baidu by analyzing the search engine parameters), and then the search term is added to the simulated address. 2. The input parameter of the function is a simulated address. String query = URLEncoder. encode ("panzhuting", "UTF-8"); String url = "http://www.baidu.com/s? Wd = "+ query +" & pn = "+ p * 10 +" & tn = baiduhome_pg & ie = UTF-8 "public void MakeQuery (String domain) {try {HttpClient httpClient = new HttpClient (); GetMethod getMethod = new GetMethod (domain); // System. out. println ("************************************* ************************"); // System. out. println (getMethod); try {httpClient.exe cuteMethod (getMethod);} catch (Exception e) {System. out. println ("network problem");} getMet Hod. getParams (). setParameter (HttpMethodParams. RETRY_HANDLER, new DefaultHttpMethodRetryHandler (); int statusCode = httpClient.exe cuteMethod (getMethod); if (statusCode! = HttpStatus. SC _ OK) {System. err. println ("Method failed:" + getMethod. getStatusLine ();} byte [] responseBody = getMethod. getResponseBody (); // System. out. println ("************************************* ************************"); // System. out. println (responseBody); String response = new String (responseBody, "UTF-8"); // System. out. println ("************************************* ************************"); // System. out. println (response); // parse html Document doc = Jsoup. parse (response); // System. out. println ("************************************* ************************"); // System. out. println (doc); Elements contents = doc. getElementsByClass ("f"); for (Element content: contents) {Element links = content. getElementsByTag (""). first (); String linkHref = links. attr ("href"); // link String linkText = links. text (); // summary FoursearchZH. map. put (linkHref, linkText); System. out. println ("------------------"); System. out. println (linkHref); System. out. println (linkText);} www.2cto.com} catch (Exception e) {System. err. println ("Something went wrong... "); e. printStackTrace ();}}