title: extract single string from HTML using Ruby/Mechanize (and Nokogiri)
body: <p>I am extracting data from a forum. My script <a href="https://stackoverflow.com/questions/2062051/ruby-nokogiri-parsing-html-table-ii">based on</a> is working fine. Now I need to extract date and time (21 Dec 2009, 20:39) from single post. I cannot get it work. I used FireXPath to determine the xpath.</p>
  
  <p>Sample code:</p>
  
  <pre><code> require 'rubygems'
   require 'mechanize'
  
     post_agent = WWW::Mechanize.new
      post_page = post_agent.get('http://www.vbulletin.org/forum/showthread.php?t=230708')
      puts  post_page.parser.xpath('/html/body/div/div/div/div/div/table/tbody/tr/td/div[2]/text()').to_s.strip
      puts  post_page.parser.at_xpath('/html/body/div/div/div/div/div/table/tbody/tr/td/div[2]/text()').to_s.strip
      puts post_page.parser.xpath('//[@id="post1960370"]/tbody/tr[1]/td/div[2]/text()')
  </code></pre>
  
  <p>all my attempts end with empty string or an error.</p>
  
  <hr>
  
  <p>I cannot find any documentation on using Nokogiri within Mechanize. <a href="http://mechanize.rubyforge.org/mechanize/GUIDE_rdoc.html" rel="nofollow noreferrer">The Mechanize documentation</a> says at the bottom of the page:</p>
  
  <blockquote>
    <p>After you have used Mechanize to navigate to the page that you need to scrape, then scrape it using Nokogiri methods.</p>
  </blockquote>
  
  <p>But what methods? Where can I read about them with samples and explained syntax? I did not find anything on <a href="http://nokogiri.org/" rel="nofollow noreferrer">Nokogiri's site</a> either.</p>