getNeibours方法

public static String[] getNeibours(String userName)throws
HttpException,IOException
{
String[] user = new String[7];
String html =
getHtml("http://acm.hdu.edu.cn/userstatus.php?user="+userName);//spider类已存在的getHtml函数
int beg = html.indexOf("Neighbours");
int k = 0;
char ch;
while(beg != -1){
beg = html.indexOf("userstatus.php?user=");
String tmp = new String();
if(beg == -1)
return user;
ch  = html.charAt(beg);
while(ch != '"')
{
tmp += ch;
beg ++;
ch = html.charAt(beg);
}
html = html.substring(beg);
user[k] = getUser(tmp);
k++;
}
return user;//返回一个包含7个user的string数组
}