title: using variable in xpath on ruby with nokogiri
body: <pre><code>require 'nokogiri'
  require 'open-uri'
  
  1.upto(10) do |x|
  url = TOPSECRET
  page = Nokogiri::HTML(open(url))
  
  title = page.xpath('//span[@class="tit"][#{x}]').inner_html
  
  puts "#{x}, #{title}"
  end
  </code></pre>
  
  <p>the error occurs [#{x}] &lt;= here</p>
  
  <p>how can I fix this?</p>