title: Scraping with Nokogiri and Ruby before and after JavaScript changes the value
body: <p>I have a program that scrapes value from  <a href="https://web.apps.markit.com/WMXAXLP?YYY2220_zJkhPN/sWPxwhzYw8K4DcqW07HfIQykbYMaXf8fTzWT6WKnuivTcM0W584u1QRwj" rel="nofollow">https://web.apps.markit.com/WMXAXLP?YYY2220_zJkhPN/sWPxwhzYw8K4DcqW07HfIQykbYMaXf8fTzWT6WKnuivTcM0W584u1QRwj</a></p>
  
  <p>My current code is:</p>
  
  <pre><code>doc = Nokogiri::HTML(open(source_url))
  
  puts doc.css('span.indexDate').text
  date = doc.css('span.indexDate').text
  date = Date.parse(date)
  puts date
  values = doc.css('table#CdsIndexTable td.col2 span')
  puts values
  </code></pre>
  
  <p>This scrapes the date and values of the second column from the "CDS Indexes" table correctly which is fine. Now, I want to scrape the similar values from the "Bond Indexes" table where I am facing the problem.</p>
  
  <p>I can see a JavaScript function changes it without loading the page and without changing the URL of the page. The difference between these two tables is their IDs are different which is exactly that it should be. But, unfortunately when I try with:</p>
  
  <pre><code>values = doc.css('table#BondIndexTable')
  puts values
  </code></pre>
  
  <p>I get nothing from the Bond Indexes table. But I get values from CDS Indexes table if I use:</p>
  
  <pre><code>values = doc.css('table#CdsIndexTable')
  puts values
  </code></pre>
  
  <p>How can I get the values from both tables?</p>