Import java.io. *;
Import java.net. *;
Class 9cbs {public static void main (string [] args) throws exception {string strunt; string ss; int ket = 0;
// Treat the start of the month, the connection is the first page, and the month stringbuffer sbmonth = new stringbuffer ("");
Strurl = "#";
URL URL = New URL (StrURL);
UrlConnection conn = url.openConnection ();
BufferedReader Rd = New BufferedReader (CONN.GETITINPUTSTREAM (), "UTF8");
System.out.println ("successfully connected.");
INT i = 0; int J = 0;
While ((ss = rd.readline ())! = NULL) {
IF (SS.Indexof ("Year")> 0 && S.Indexof ("ID")> 0 && Ss.indexof ("SingleColumn")> 0) {i = ss.indexof ("Archive"); if (i> 0) { J = ss.indexof (". ASPX", I); if (j> 0) {sbmonth.append (Strull "/" ss.substring (i, j) ". aspx"); sbmonth.append (" , ");}}}}} Rd.close (); system.out.println (" Analysis Month List Success "); // Processing the end of the month, get a SBMONTH string containing monthly URL addresses
// Handling monthly, analyze month list list stringbuffer sbarticle = new stringbuffer (""); string [] str = sbmonth.tostring (). Split (",");
for (int i_m = 0; i_m While ((ss = rd.readline ())! = null) {if (ss.indexof ("posttitle"> 0) {bprint = true;} if (ss.indexof ("postText")> 0) {Bprint = false;} {i = ss.indexof ("http"); if (i> 0) {j = ss.indexof (". ASPX", i); if (j> 0) {sbarticle. Append (s.SUBSTRING (I, J) ". ASPX"); sbarticle.append (",");}}}}} system.out.println ("Get URL Address List of All Articles"); / / Get the end of the monthly article list, get the URL address of all articles // Get every article content start system.out.println ("/ r / n save article start ..."); string [] str1 = sbarticle.tostring (). Split (","); for (int i_n = 0; i_n RandomaccessFile Rf = new randomaccessfile ("9cbs_cqq _" iCount ". HTM", "RW"); Boolean bb = true; while ((ss = rd.readline ())! = null && bb) { IF ("PostTitle"> 0) {bPrint1 = true;} if ("postfoot")> 0) {bprint1 = false;} if (bprint1) {sb.append (ss); }} Byte [] b; b = sb.tostring (). GetBytes (); rf.write (b); rf.close ();} system.out.println ("Complete, save" iCount "article ");}}