My guess is that the problem is in the XPath here:
static final String xpathTableContents = "//div[@id='text11']";
As I mentioned in my comment, the //div[@id='text11']
XPath is trying to select any div
element with an id
attribute equal to text11
, however there are no such div elements in the referenced HTML page.
Could you please show me an example on how to select ANY table content? Just show me an XPath code for any table content you want so that I somehow "get the structure".
Using the HTML page you referenced, to select the div containing "2. ura", for example:
//*[@id="seznam_ur_teden"]/table/tbody/tr[3]/td[1]/div[1]
To select just the text there,
//*[@id="seznam_ur_teden"]/table/tbody/tr[3]/td[1]/div[1]/text()
To select the entire ancestral table:
//*[@id="seznam_ur_teden"]/table