tags:

views:

80

answers:

0

How do I target one form from another when there are 2 forms in the same page like this page?

http://screener.finance.yahoo.com/stocks.html

Here's my sample code:

require 'rubygems'
require 'scrubyt'

extractor = Scrubyt::Extractor.define do
  fetch 'http://screener.finance.yahoo.com/stocks.html'
  select_option('prmin', '5')
  select_option('prmax', '10') 
  submit

  row "//body/table/tr/td/table[1]/tr" do
    symbol "/td[1]"
    company "/td[2]"
    retail_price "/td[3]"
    beta "/td[4]"
  end.select_indices([:all_but_first])

  next_page "Next 20", :limit => 2
end

puts extractor.to_xml
exit