Analysis of Java Realization Webpage Take Content

xiaoxiao2021-03-06  62

Excerpt from http://blog.9cbs.net/warlife/archive/2004/09/27/118665.aspx

There are many websites to provide news from other websites, even from the translation site to take the content of the website. Due to the website, the website needs to be involved in this area, so recently, I have studied it here. I will write it to you. I hope everyone will discuss the common progress. First I think the implementation of this feature is actually relying on the analysis of the packet. My idea is to take the entire source code of the website first intercept the website and then analyze the HTML code of the package to find the commonality of the HTML code required to find the commonality of these commonality. The code came out and finally streamline these excess code, I have written a rough program to get the translation of Jinshan Words, let everyone ask the way, how is the conversion of this Encode, I don't want to solve the Import Java. .NET. *; Import java.io. *; public class gethead {public static string str = " int. "; public static string end =" "; URL url; URLConnection uc; InputStream in; DataInputStream din; String get; StringBuffer sb; StringBuffer add; DataInputStream in1; public gethead () {int i = 0; sb = new StringBuffer (); add = New stringbuffer (); add.append ("http://cb.kingsoft.com/search?s="); System.out.Println ("Input The Word You Want To Get:"); TRY {IN1 = New DataInputStream (System.IN); string word = in1.readline (); add.append (word) .append ("& lang = utf-8"); URL = New url (add.toString ()); UC = url.openconnection (); in = uc.getinputStream (); DIN = New DataInputStream (in); while ((get = din.readline ())! =

转载请注明原文地址:https://www.9cbs.com/read-111860.html

New Post(0)