title: Trying to scrape a table via Watir and Nokogiri
body: <p>I'm new to ruby and I am trying to scrape a table and put it onto a csv. I want to scrape the table from this url: <a href="http://www.inc.com/inc5000/list/2015/" rel="nofollow">http://www.inc.com/inc5000/list/2015/</a></p>
  
  <p>I need to record all the info in the table, which would be td class="c1" through td class="c8". My while loop is not working properly so I haven't been able to automate.</p>
  
  <p>I'll post the code I currently have, but it is basically nothing.</p>
  
  <pre><code>require 'watir'
  require 'open-uri'
  require 'net/http'
  require 'csv'
  require 'nokogiri'
  
  b = Watir::Browser.new :firefox
  b.goto 'http://www.inc.com/inc5000/list/2015/'
  acount = 49
  p = Nokogiri::HTML.parse(b.html)
  company = p.css(css).text
  company = []
  puts css
  #right &gt; table &gt; tbody &gt; tr:nth-child(1) &gt; td.c2
  "#right &gt; table &gt; tbody &gt; tr:nth-child(1) &gt; td"
  csscompany1 = ".cd2"
  csscompany1 = ".cd"
  css1 = "#right &gt; table &gt; tbody &gt; tr:nth-child"
  css2 = "(#count)"
  css3 = " &gt; td.c2"
  while count != 49 do
  acss = "#{css1}#{css2}#{css3}
  company.push(p.css(acss).text)
  count += 1
  end 
  </code></pre>