package omx;
import tool.*;
import java.io.*;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] credit=new String[5000];
String[] name=new String[5000];
int number;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
int tr;
for(tr=100;tr<101;tr++){
String urlx="http://www1.plala.or.jp/nakaatsu/"+tr+"omo.htm";
if(tr<10)urlx="http://www1.plala.or.jp/nakaatsu/0"+tr+"omo.htm";
if(tr==100) urlx="http://www1.plala.or.jp/nakaatsu/00omo.htm";
getdata sub2=new getdata();
sub2.makedata(urlx,"SJIS");
data=sub2.data;
datanumber=sub2.datanumber;
int s1=0;
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("CELLPADDING=8")>-1)s1=s;
}
int s2=0;
for(s=s1;s<datanumber+1;s++){
int h=0;
if(s2==0)h=h+1;
if(data[s].indexOf("</TABLE")>-1)h=h+1;
if(h==2)s2=s;
}
String str="";
for(s=s1;s<s2;s++){
str=str+data[s];
}
String[] x=str.split("</TR>");
int sx;
for(s=0;s<x.length;s++){
String[] y=x[s].split("</TH>");
for(sx=0;sx<y.length;sx++){
if(sx==2)credit[s]=change(y[sx]);
if(sx==3)name[s]=change(y[sx]);
}
System.out.println(tr+","+name[s]+","+credit[s]);
}
}
}
String change(String str){
int n;
for(n=1;n<21;n++){
str=rev(str);
}
str=str.replace(" ","");
return str;
}
String rev(String str){
if(str==null)str="";
int p1=str.indexOf("<");
int p2=str.indexOf(">",p1);
String strx="";
if(p2>-1)strx=str.substring(p1,p2+1);
str=str.replace(strx,"");
return str;
}
}
最終更新:2016年03月21日 19:19