From: David Wright Date: 2010-05-21T02:19:02+09:00 Subject: Re: Scrape javascript content Mechanize cannot execute javascript but watir/celerity can. (I've never used harmony) #in watir (could also use firewatir and/or the safari equivalent) require 'watir' require 'watir/ie' # should work identically with celerity #require 'celerity #@browser = Celerity::IE.new @login_page = 'http://example.com/' @browser = Watir::IE.new @browser.goto @login_page @browser.text_field(:name, 'username').set(@user) @browser.text_field(:name, 'password').set(@pass) @browser.button(:value, "LogIn").click # go to page where the javascript link is @broswer.link(:text, "Link Name").click # click it # this assumes the fireClick event is 'just' an ajax call which returns content @broswer.link(:id, "iroc_0").click @browser.wait # wait for ajax to return # show page's displaying text (not view source) puts @browser.text # if above fires a pop up window more code is needed to retrieve the content -- Posted via http://www.ruby-forum.com/.