Dave Burt
5/24/2006 12:54:00 PM
PP wrote:
> In my daliy work there are some project budget with the form "Between
> $1,000 and $ 1200" to gather The html codes for this is as following.
> What's more this part is in a table
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> <tr><td valign="top" class="small" colspan="2"><b>Project Budget:</b>
> Between $1,000 and $1,500<br><img src="/images/spacer.gif" height="5"
> width="1" border="0"><br></td></tR>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Now I want to get the Budget in such pages normally more than 30. Can
> any funtion get the whole string "Between $1,000 and $ 1,500" by a
> regexp or something else.
> I have tried the function " contains_text" but it returns a number.
> Can anyone tell me what the number means and how can it get in touch
> with the string I want
> btw: the money is different but the form is always the same.
>
> Can anyone help me ?
>
If you're using Watir (as I guess from your mention of contains_text)
then that number is probably an index into the string of the start of
that substring. So ie.text[n, 7], where n is the number you got from
ie.contains_text, should give you "Between" (7 characters).
Cheers,
Dave