?? htmlparse.java~11~
字號(hào):
package news;/** * <p>Title: 新聞搜索引擎</p> * <p>Description: 畢業(yè)設(shè)計(jì)</p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author 計(jì)算機(jī)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()); //System.out.println("================================="); //System.out.println("HREF: " + _herf); //System.out.println("TITLE: " + _title); //_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; }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -