On Nov 15, 10:31 am, Joe Fl <[email protected]> wrote:
> Hi,
>
> I am trying to get the ids for the 'Themes' listed within our site.
>
> HTML code:
>
> <div id="index">
> <div id="community_resources_list_2255" class="">
> <div class="resources">
> <h3>Novo Nordisk Connection Approved Resources</h3>
> <dl class="documents-grouped">
> <dt id="resources_channel_resource_category_114" class="twisty-head no-
> resources">
> <strong class="twisty">
> Clinical
> <span class="showing">0 resources</span>
> </strong>
> <ul class="tertiary-buttons">
> <li class="admin-item">
> <a class="add-channel-resource" href="/channels/novo-nordisk-
> connection/channel_resources/new?theme_id=114">
> <span>Add Resource</span>
> </a>
> </li>
> </ul>
> </dt>
> <dd class="twisty-drop no-resources"> </dd>
> <dt id="resources_channel_resource_category_113" class="twisty-head no-
> resources">
> <dd class="twisty-drop no-resources"> </dd>
> <dt id="resources_channel_resource_category_116" class="twisty-head no-
> resources">
> <dd class="twisty-drop no-resources"> </dd>
> <dt id="resources_channel_resource_category_117" class="twisty-head no-
> resources">
> <dd class="twisty-drop no-resources"> </dd>
> <dt id="resources_channel_resource_category_115" class="twisty-head no-
> resources">
> <dd class="twisty-drop no-resources"> </dd>
> <dt id="resources_channel_resource_category_118" class="twisty-head no-
> resources">
> <dd class="twisty-drop no-resources"> </dd>
> </dl>
> </div>
>
> You will see the ids are in dt tag.  I have tried using lis and link
> and both give me 'Add Resource' link.
>
> Is there a method to get the ids from the dt?
>
> Thank you,
> Joe

Why would you try to use a collection of LI elements to get
information that is not contained anywhere inside those elements? If
the info you want is part of a dt (description item) tag, then you
need to build your collection out of those tags.

browser.dts(:class => "twisty-head no-resources").each do |item|
  puts item.attribute_value('id')
end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to