Note that there are some explanatory texts on larger screens.

plurals
  1. POScreen scrape web page that displays data page wise using Mechanize
    primarykey
    data
    text
    <p>I am trying to screen scrape a web page (using Mechanize) which displays the records in a grid page wise. I am able to read the values displayed in the first page but now need to navigate to the next page to read appropriate values.</p> <pre><code>&lt;tr&gt; &lt;td&gt;&lt;span&gt;1&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$2')"&gt;2&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$3')" &gt;3&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$4')" &gt;4&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$5')" &gt;5&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$6')"&gt;6&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$7')" &gt;7&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$8')"&gt;8&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$9')" &gt;9&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$10')" &gt;10&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:__doPostBack('gvw_offices','Page$11')"&gt;...&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>I am able to get through all the links but when I try this:-</p> <pre><code>links = (row/"a") links.each do |link| agent.click link.attributes['href'] # This fails agent.click link # This also fails end </code></pre> <p>Reason is that agent.click expects the URL as an argument.</p> <p>Is there a way where we can read all the values when they are displayed page wise ? If not how can we have such a click action when the href is a postback and not a URL??</p>
    singulars
    1. This table or related slice is empty.
    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