Member Avatar for nugroho2

I am a very new beginner in XPATH, so apologize if this is not the place to ask.

I want to select the Child Table 2 within the table below using XPath.

<table width="100%" border="0" cellspacing="0" cellpadding="0"> //// MAIN TABLE 
    <tr>
        <td colspan="2" style="padding-left: 2px;">
           <table border=0 width=100% cellspacing=0>   //// CHILD TABLE 1 
	      ....
	   </table><P>
        </td>
    </tr>
    <tr>
	<td colspan="2">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">  //// CHILD TABLE 2 
		<tr>
			<td width =34% class='outline'>Item</td>
			<td width =45% class='outline'>Price</td>
		</tr>
           </table>
        </td>
    </tr>
</table>

I believe the expresion can be :

1. Expression that directly select Child Table 2. Is this correct?

//table/table(2)

2. Expression to select table that has the word "Item" or "Price".

//table[(contains(normalize-space(.),'Price'))]

But this would also select the parent table.

What should I write in the code in both cases ? Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.