HtmlParser給我們提供的Tag比較多.但是像這樣的網(wǎng)頁(yè)好像都是不行哦.因?yàn)镠tmlParser只提供到  TableColumn, TableHeader, TableRow, TableTag, 沒(méi)有直接提供tr,td這種一看就明白的Tag,那我們?nèi)绾谓鉀Q這個(gè)問(wèn)題.方法就是繼承HtmlParser的Tag.呵呵.其實(shí)繼承他很簡(jiǎn)單.看代碼.

public class TrTag extends CompositeTag {
    
/**
     * The set of names handled by this tag.
     
*/

    
private static final String[] mIds = new String[] "TR" };

    
/**
     * The set of end tag names that indicate the end of this tag.
     
*/

    
private static final String[] mEndTagEnders = new String[] "TABLE" };

    
/**
     * Create a new div tag.
     
*/

    
public TrTag() {
    }


    
/**
     * Return the set of names handled by this tag.
     * 
     * 
@return The names to be matched that create tags of this type.
     
*/

    
public String[] getIds() {
        
return (mIds);
    }


    
/**
     * Return the set of end tag names that cause this tag to finish.
     * 
     * 
@return The names of following end tags that stop further scanning.
     
*/

    
public String[] getEndTagEnders() {
        
return (mEndTagEnders);
    }

}

呵呵.有了這一招,對(duì)待這樣的NBA網(wǎng)頁(yè)易如反掌了.當(dāng)然了對(duì)待其他標(biāo)簽也一樣的做法.

==================說(shuō)明分隔線===========
說(shuō)的很簡(jiǎn)單.請(qǐng)大家諒解.:)