3 回答

TA貢獻1744條經驗 獲得超4個贊
可以使用Python自帶的HTMLParser模塊解析HTML文檔:
HTMLParser的核心模塊是org.htmlparser.Parser類,這個類實際完成了對于HTML頁面的分析工作。這個類有下面幾個構造函數:
public Parser ();
public Parser (Lexer lexer, ParserFeedback fb);
public Parser (URLConnection connection, ParserFeedback fb) throws ParserException;
public Parser (String resource, ParserFeedback feedback) throws ParserException;
public Parser (String resource) throws ParserException;
public Parser (Lexer lexer);
public Parser (URLConnection connection) throws ParserException;
和一個靜態類public static Parser createParser (String html, String charset);

TA貢獻1712條經驗 獲得超3個贊
可以使用Python自帶的HTMLParser模塊解析HTML文檔:
HTMLParser的核心模塊是org.htmlparser.Parser類,這個類實際完成了對于HTML頁面的分析工作。這個類有下面幾個構造函數:
public Parser ();
public Parser (Lexer lexer, ParserFeedback fb);
public Parser (URLConnection connection, ParserFeedback fb) throws ParserException;
public Parser (String resource, ParserFeedback feedback) throws ParserException;
public Parser (String resource) throws ParserException;
public Parser (Lexer lexer);
public Parser (URLConnection connection) throws ParserException;
和一個靜態類public static Parser createParser (String html, String charset);
- 3 回答
- 0 關注
- 1631 瀏覽
添加回答
舉報