title: How to click link in Mechanize and Nokogiri?
body: <p>I'm using Mechanize to scrape Google Wallet for Order data. I am capturing all the data from the first page, however, I need to automatically link to subsequent pages to get more info. </p>
  
  <p>The #purchaseOrderPager-pagerNextButton will move to the next page so I can pick up more records to capture. The element looks like this. I need to click on it to keep going. </p>
  
  <pre><code>&lt;a id="purchaseOrderPager-pagerNextButton" class="kd-button small right"
   href="purchaseorderlist?startTime=0&amp;amp;...
  ;currentPageStart=1&amp;amp;currentPageEnd=25&amp;amp;inputFullText="&gt;
  &lt;img src="https://www.gstatic.com/mc3/purchaseorder/page-right.png"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>However, when I try the following I get an error:</p>
  
  <pre><code>  next_page = @orders_page.search("#purchaseOrderPager-pagerNextButton")
    next_page.click
  </code></pre>
  
  <p>The error: </p>
  
  <pre><code>undefined method `click' for #&lt;Nokogiri::XML::NodeSet:0x007f9019095550&gt; (NoMethodError)
  </code></pre>