?? htmlparse.java~13~
字號:
package news;/** * <p>Title: 新聞搜索引擎</p> * <p>Description: 畢業設計</p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author 計算機99630 沈晨 * @version 1.0 */import java.util.Iterator;import java.util.Vector;import com.heaton.bot.HTMLPage;import com.heaton.bot.HTTP;import com.heaton.bot.Link;public class HTMLParse { HTTP _http = null; public HTMLParse(HTTP http) { _http = http; } public void start() { try { HTMLPage _page = new HTMLPage(_http); _page.open(_http.getURL(), null); Vector _links = _page.getLinks(); Index _index = new Index(); Iterator _it = _links.iterator(); while (_it.hasNext()) { Link _link = (Link) _it.next(); String _herf = input(_link.getHREF().trim()); String _title = input(_link.getPrompt().trim()); _index.AddNews(_herf,_title); } _index.close(); } catch (Exception ex) { System.out.println(ex); } } public static String input(String str) { String temp = null; if (str != null) { try { temp = new String(str.getBytes("ISO8859_1")); } catch (Exception e) { } } return temp; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -