Note that there are some explanatory texts on larger screens.

plurals
  1. POClicking the "Show more" link on a LinkedIn group page using Ruby Mechanize
    primarykey
    data
    text
    <p>I have logged in to Linkedin and reached my groups page using Ruby Mechanize. I am also able to retrieve the list of questions on the page. However, I am unable to click the "Show more" link at the bottom so that I can the entire page and hence all the questions:</p> <pre><code>require 'rubygems' require 'mechanize' require 'open-uri' a = Mechanize.new { |agent| # LinkedIn probably refreshes after login agent.follow_meta_refresh = true } a.get('http://linkedin.com/') do |home_page| my_page = home_page.form_with(:name =&gt; 'login') do |form| form.session_key = '********' #put you email ID form.session_password = '********' #put your password here end.submit mygroups_page = a.click(my_page.link_with(:text =&gt; /Groups/)) #puts mygroups_page.links link_to_analyse = a.click(mygroups_page.link_with(:text =&gt; 'Semantic Web')) link_to_test = link_to_analyse.link_with(:text =&gt; 'Show more...') puts link_to_test.class # link_to_analyse.search(".user-contributed .groups a").each do |item| # puts item['href'] # end end </code></pre> <p>Although a link exists with text 'Show more...' in the page, I am somehow not able to click it.the link_to_test.class shows NilClass What is the possible problem?</p> <pre><code>The part of the page I need to reach is: &lt;div id="inline-pagination"&gt; &lt;span class="running-count"&gt;20&lt;/span&gt; &lt;span class="total-count"&gt;1134&lt;/span&gt; &lt;a href="groups?mostPopularList=&amp;amp;gid=49970&amp;amp;split_page=2&amp;amp;ajax=ajax" class="btn-quaternary show-more-comments" title="Show more..."&gt; &lt;span&gt;Show more...&lt;/span&gt; &lt;img src="http://static01.linkedin.com/scds/common/u/img/anim/anim_loading_16x16.gif" width="16" height="16" alt=""&gt; &lt;/a&gt; &lt;/div&gt; </code></pre> <p>I need to click the show more... I can use links_with(:href => ..) but doesnt seem to work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload