public static void main(String[] args) throws Exception {

		String htmlcode = GetWebString.getWeb();
		Parser parser = Parser.createParser(htmlcode, "GBK");
		HtmlPage page = new HtmlPage(parser);// HtmlPageHtmlPage(Parser parser)

		try {
			parser.visitAllNodesWith(page);// HtmlPage extends visitor,Apply the given visitor to the current page.
		} catch (ParserException e1) {
			e1 = null;
		}

		NodeList nodelist = page.getBody();// еĽڵ
		NodeFilter filter = new TagNameFilter("A");
		nodelist = nodelist.extractAllNodesThatMatch(filter, true);

		for (int i = 0; i < nodelist.size(); i++) {
			LinkTag link = (LinkTag) nodelist.elementAt(i);
			System.out.println(link.getAttribute("href") + "\n");
			System.out.println(link.getStringText());

		}

	}