title: How do I scrape data through Mechanize and Nokogiri?
body: <p>I am working on an application which gets the HTML from <a href="http://www.screener.in/" rel="nofollow">http://www.screener.in/</a>.</p>
  
  <p>I can enter a company name like "Atul Auto Ltd" and submit it and, from <a href="http://www.screener.in/company/?q=Atul+Auto+Ltd" rel="nofollow">the next page</a>,
  scrape the following details: "CMP/BV" and "CMP". </p>
  
  <p>I am using this code:</p>
  
  <pre><code>require 'mechanize'
  require 'rubygems'
  require 'nokogiri'
  
  Company_name='Atul Auto Ltd.'
  agent = Mechanize.new
  page = agent.get('http://www.screener.in/')
  form = agent.page.forms[0]
  print agent.page.forms[0].fields
  agent.page.forms[0]["q"]=Company_name
  button = agent.page.forms[0].button_with(:value =&gt; "Search Company")
  pages=agent.submit(form, button)
  puts pages.at('.//*[@id="top"]/div[3]/div/table/tbody/tr/td[11]')
  # not getting any output.
  </code></pre>
  
  <p>The code is taking me to the right page but I am don't know how to query to get the required data.</p>
  
  <p>I tried different things but was unsuccessful.</p>
  
  <p>If possible, can someone point me towards a nice tutorial which explains how to scrape a particular class from an HTML page. 
  The XPath of the first "CMP/BV" is:</p>
  
  <pre><code>//*[@id="top"]/div[3]/div/table/tbody/tr/td[11]
  </code></pre>
  
  <p>but it is not giving any output.</p>