Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since you are working with JavaScript you have two options. Analyzing the JS to see what it's doing then sending those requests manually or you need to control an app that supports JS - a web browser.</p> <p>Look here for info on the first option : <a href="https://stackoverflow.com/a/8304040/991805">https://stackoverflow.com/a/8304040/991805</a></p> <p>As for the second, given what I know, I was able to get it to work using Firefox controlled by Ruby.</p> <pre><code>require 'rubygems' require 'watir-webdriver' require 'nokogiri' browser = Watir::Browser.new browser.goto('http://www.q102.com/pages/jb-brackets/') browser.radios[-1].focus (browser.radios.length / 2).times do |i| browser.radios[1].set browser.buttons[1].click browser.radios[0].focus sleep 0.5 end temp = [] source = Nokogiri::HTML(browser.html) source.css('.brackets tbody tr td div tbody table tbody tr td').each {|a| temp &lt;&lt; a.text.strip!} browser.close puts temp </code></pre> <p>This will output :</p> <pre><code>Big Time Rush 55.15 % Flo Rida 44.85 % Lady GaGa 44.22 % Kelly Clarkson 55.78 % Demi Lovato 50.19 % Avril Lavigne 49.81 % Justin Bieber 48.26 % Train 51.74 % David Archuleta 45.92 % Jordin Sparks 54.08 % Adam Lambert 53.56 % Pitbull 46.44 % Joe Jonas 54.16 % All Time Low 45.84 % Selena Gomez 50.37 % Katy Perry 49.63 % </code></pre> <p>This script works on Mac and needs the two following gems (libraries) to run : watir-webdriver and Nokogori. As well as Firefox.</p> <p>Check that Ruby is installed <code>ruby -v</code> Check that gem is installed <code>gem -v</code> Install the libraries <code>gem install watir-webdriver nokogiri</code> Run the script <code>ruby ratings.rb</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload