I'm trying to test against the class name of a span. I'm iterating
through all spans and basically want to say, "If ie.spans[x]'s value for
class = "SSSBUTTON_CONFIRMLINK" then return the inner text of the span"
print ie.spans[x] returns the following
type:
id:
name:
value:
disabled: false
class: SSSBUTTON_CONFIRMLINK
text: Start a New Search
Anyone know how to accomplish this? I haven't been able to figure out
the command to return the class name of a span. I know ie.spans[x].text
will return the inner text but I don't know the code for any of the
other attributes. i tried using :class also to no avail.
What is "ie"? You don't specify which libraries you are using. Unless
you give a little bit more detail it's difficult to help.
Jesus.
···
On Fri, Nov 6, 2009 at 11:43 AM, Mike Hin <michael.hincke@gmail.com> wrote:
I'm trying to test against the class name of a span. I'm iterating
through all spans and basically want to say, "If ie.spans's value for
class = "SSSBUTTON_CONFIRMLINK" then return the inner text of the span"
print ie.spans returns the following
type:
id:
name:
value:
disabled: false
class: SSSBUTTON_CONFIRMLINK
text: Start a New Search
Anyone know how to accomplish this? I haven't been able to figure out
the command to return the class name of a span. I know ie.spans.text
will return the inner text but I don't know the code for any of the
other attributes. i tried using :class also to no avail.
I'm trying to test against the class name of a span. I'm iterating
through all spans and basically want to say, "If ie.spans's value for
class = "SSSBUTTON_CONFIRMLINK" then return the inner text of the span"
print ie.spans returns the following
type:
id:
name:
value:
disabled: false
class: SSSBUTTON_CONFIRMLINK
text: Start a New Search
Anyone know how to accomplish this? I haven't been able to figure out
the command to return the class name of a span. I know ie.spans.text
will return the inner text but I don't know the code for any of the
other attributes. i tried using :class also to no avail.
Thanks for any help,
Mike
Try something like this(untested):
ie.spans.each do |span|
if span.class == "SSSBUTTON_CONFIRMLINK"
span.text
end
end
Oh wow, thats what I get for posting at 3am. I am using Watir and ie is
the browser being driven. sorry.
Jesús Gabriel y Galán wrote:
···
On Fri, Nov 6, 2009 at 11:43 AM, Mike Hin <michael.hincke@gmail.com> > wrote:
disabled: � � false
class: � � � �SSSBUTTON_CONFIRMLINK
text: � � � � Start a New Search
Anyone know how to accomplish this? I haven't been able to figure out
the command to return the class name of a span. I know ie.spans.text
will return the inner text but I don't know the code for any of the
other attributes. i tried using :class also to no avail.
What is "ie"? You don't specify which libraries you are using. Unless
you give a little bit more detail it's difficult to help.