hi all,

I need to parse a html file and retrieve a few values from a table
contained in the body. To begin with I am using the following code
snippet to retrieve value for the "title" attribute.

Document doc = new SAXReader().read(new File(
                                "D:/work//javascript/mod_v365_2.html"));
XPath path = doc.createXPath("/html/head/title");
System.out.println(path.evaluate(doc));

The final xpath value I am interested in is all the Nodes
/html/body/table/tbody/tr/td/table[2]/tbody/tr/td/table[2]//tr

However path.evaluate(doc) is returning a zero length array. I am
confused and not sure why this could be happening especially since I
know that these nodes exist in the document.

I am attaching the html file for reference.

Any help or pointers would be great.

Thanks
anand raman
Title: BMTC Search Bus by Bus Numbers



Welcome to BMTC Online Bus Route Information System

Print
Route Number: V365
  Starting Point
:
   BANNERGHATTA NATIONAL PARK
   Ending Point
:
   KEMPEGOWDA BUS STATION
  Route Length [in KMS]
:
  23.0
  Estimated Journey Time  [in Min]
:
  1 hr 10 mins
  Time of Departure from
  [  BANNERGHATTA NATIONAL PARK  ]
:
   08:35, 09:45, 10:35, 11:05, 11:25, 12:35, 13:00, 13:35
   13:45, 14:55, 15:45, 16:20, 16:30, 17:15, 18:15, 18:40
  Time of Departure from 
  [  KEMPEGOWDA BUS STATION  ]
:
   07:30, 08:30, 08:55, 09:30, 09:45, 11:00, 11:45, 12:25
   12:35, 13:45, 14:10, 14:45, 14:55, 16:05, 17:00, 17:30

SL.NO
STAGE POINTS
1.
     KEMPEGOWDA BUS STAND
2.
     MRC/KVB
3.
     CORPORATION/PALLAVI
4.
     WILSON GARDEN POLICE STN
5.
     BANGALORE DAIRY
6.
     GURAPPANAPALYA
7.
     BILEKALLAHALLI
8.
     HULIMAVU GATE
9.
     GOTTIGERE
10.
     BASAVANAPURA
11.
     KALKERE
12.
     BANNERGHATTA CIRCLE
13.
     BANNERGHATTA NATIONAL PARK

Click here For Route Map
:
Route Map


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to