Hi,

I need to retrieve multiple discusion titles from a page. I just want
the titles only and there can be 5 to 13 on a page with other links
listed under them.  I have tried the following and it will only return
the first discussion title or all links:

subject_lines =
$browser.div(:class,'one_col_select').div(:id,'naph').div(:id,'discussion-
board').span(:class,'discussion-title').links

subject_lines.each do|link|
    puts title_name = link.text
end

Test Image Thu Oct 20 15:23:56 -0400 2011


subject_lines = $browser.div(:id,'discussion-
board').span(:class,'discussion-title').links

subject_lines.each do|link|
    puts title_name = link.text
end

Test Image Thu Oct 20 15:23:56 -0400 2011


subject_lines = $browser.div(:id,'discussion-board').links
subject_lines.each do|link|
    puts title_name = link.text
end


Add

* Test Image Thu Oct 20 15:23:56 -0400 2011
Matthew James Berman, MD
Budget Management
Government Relations
Grants/Funding

Read more
0 comments
Add a comment

* Check out this document Thu Oct 20 15:23:20 -0400 2011
Matthew James Berman, MD
Budget Management
Government Relations
Read more
DataFile.xls
0 comments
Add a comment

- in the above the * line is the only line I want for each listed on
the page.

subject_lines = $browser.div(:class,'discussion-meta-wrap').links

subject_lines.each do|link|
    puts title_name = link.text
end

* Test Image Thu Oct 20 15:23:56 -0400 2011
Matthew James Berman, MD
Budget Management
Government Relations
Grants/Funding

HTML code:

<div id="community_resources_list_2161" class="">
<dl id="theme-resource-list" class="discussions-block list-page">
<dt class="discussion-meta image-attachment">
<div class="profile-pic">
<a class="person-inline-profile" title="NAPH Member Community"
href="http://0.0.0.0:3000/profiles/2/show_other_person?
default_link=summary">
</div>
<div class="discussion-meta-wrap">
<span class="discussion-title">
<a class="theme" href="http://0.0.0.0:3000/channels/naph-member-
community/navigational_categories/discussions/pages/topic/
categorized_resource/ImageAttachment/38">Test Image Thu Oct 20
15:23:56 -0400 2011</a>
</span>
<span class="dtposted">
<span class="related-topics">
</div>
</dt>
<dd class="discussion image-attachment">
<div class="discussion-wrap">
<div class="image-details">
<a href="/channels/naph-member-community/image_attachments/38?
theme_id=91">
<img class="image_thumbnail" width="84" height="63" src="/attachments/
38_thumbnail.jpg?1319138639">
</a>
</div>
<div class="discussion-body">
</div>
<ul class="action-links">
</dd>
<dt class="discussion-meta file-attachment">
<div class="profile-pic">
<div class="discussion-meta-wrap">
<span class="discussion-title">
<a class="theme" href="http://0.0.0.0:3000/channels/naph-member-
community/navigational_categories/discussions/pages/topic/
categorized_resource/FileAttachment/37">Check out this document Thu
Oct 20 15:23:20 -0400 2011</a>
</span>
<span class="dtposted">
<span class="related-topics">
</div>
</dt>
<dd class="discussion file-attachment">
<dt id="link_resource_34" class="discussion-meta link-resource">

I would appreciate any help on this.

Thank you,
Joe

-- 
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