The following url has figures and table(s), and I like to read first two columns of a table. xpatahSApply command is working fine, but I need to condition on more than two attributes and I am unable to figure out. 

```
url ="http://floodobservatory.colorado.edu/SiteDisplays/1544data.htm"

doc=htmlTreeParse(url,useInternal=TRUE)

```

sample of the parsed data 

```
<tr height="20" style="height:15.0pt">
<td height="20" class="xl6521398" align="right" style="height:15.0pt">11-Oct-13</td>
  <td class="xl7321398">1853</td>
  <td class="xl7321398"></td>
  <td class="xl8121398">0.80</td>
  <td class="xl7221398" align="right">4.87</td>
  <td class="xl1521398"></td>
  <td class="xl1521398"></td>
  <td class="xl1521398"></td>
  <td class="xl1521398"></td>
  <td class="xl1521398"></td>
  <td class="xl1521398"></td>
  <td class="xl7421398"></td>
  <td class="xl7421398"></td>
  <td class="xl7421398"></td>
  <td class="xl7421398"></td>
  <td class="xl9621398"></td>
  <td class="xl7421398"></td>
  <td class="xl8121398"></td>
 </tr>

```

I need to read values from two cells of which one corresponds to *date* and the other one corresponds to *streamflow discharge* and has below mentioned attributes

```
<td height="20" class="xl6521398" ...> and  [<td class="xl7321398"..]

```

with respect to above sample data, I need to grab "11-Oct-13" and "1853".

I used following commands to get 'dates' and 'streamflow discharge'. 

```
dates=xpathSApply(doc,"//td[@class='xl6521398']",xmlValue)

streamflowdischarge=xpathSApply(doc,"//td[@class='xl7321398']",xmlValue)

```

They successfully extracted information, but extracted values consist values from other tables/cells, and importantly 'dates' and 'streamflow discharge' do not correspond.

> 
> dates[1:10]
>  [1] "1-Jan-98" "2-Jan-98" "3-Jan-98" "31-Mar-98" "4-Jan-98" "30-Apr-98" "5-Jan-98" 
>  [8] "31-May-98" "6-Jan-98" "30-Jun-98"
> 
> 
> 

"31-Mar-98" is between "3-Jan-98" and "4-Jan-98" - something unintended

> 
> streamflowdischarge[1:10]
>  [1] "3108" "3076" "3051" "3111" "3064" "3043" "3007" "3066" "378" "" 
> 
> 
> 

"3108" does not correspond to "1-Jan-98" - can be checked at the url

It looks like there are tables/cells with same attributes, which I do not want read/grab. In this regard, I think I need to pass the entire attribute, i.e.,

```
<td height="20" class="xl6521398" align="right" style="height:15.0pt">

```

to get the 'date', and somehow I should condition such that 'streamflow discharge' from the same table is extracted.

Greatly appreciate suggestions, and also if there are other options available.

I tried readHTMLTable, but got an error "subscript out of bounds"

Thanks,
Satish