i just want to parse two values from a html file .
there will be several list elements in the html file and i want to parse two values a. 1 ,100, 101b. Swargate to Shivajinagar Circle route , Mnapa bhavan to.. ,Kothrud depot to...i have used the below code to parse it, but i am not getting the required values , here i am getting href value only.please give me any solution for the above problem\[code\] String html = "<li/><a href=http://stackoverflow.com/questions/12800991/r361.html>1</a> Swargate to Shivajinagar Circle route"+ " <li/><a href=http://stackoverflow.com/questions/12800991/r511.html>100</a> Manpa bhavan to Hinjewadi phase 3"+ "<li/><a href=http://stackoverflow.com/questions/12800991/r572.html>101</a> Kothrud depot to Kondhava Bu"; Reader reader = new StringReader(html); HTMLEditorKit.Parser parser = new ParserDelegator(); final List<String> links = new ArrayList<String>(); parser.parse(reader, new HTMLEditorKit.ParserCallback(){ public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos) { if(t == HTML.Tag.A) { Object link = a.getAttribute(HTML.Attribute.HREF); if(link != null) { links.add(String.valueOf(link)); } } } }, true); reader.close(); System.out.println(links);\[/code\]}