Skip to content

Instantly share code, notes, and snippets.

@jaigouk
Created January 5, 2009 02:44
Show Gist options
  • Select an option

  • Save jaigouk/43238 to your computer and use it in GitHub Desktop.

Select an option

Save jaigouk/43238 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'scrubyt'
# I installed firewatir on my firefox 3.0
# And running "ruby merb_readme.rb" lauches firefox and then go to the right page.
property_data = Scrubyt::Extractor.define :agent => :firefox do
fetch 'http://merbivore.com/documentation/current/doc/rdoc/stack/'
# There's also another 'files' link in the page.
# So I had to write exact location of the link.
# But this line does not work as I expected.
# I did googled for this but in vain.
# click_link "files"
click_link "//ul#groupType/li[3]"
# Actually, I want scrap whole readme in haml format.
# But nokogiri can not pass ajax like links.
doc "/div#rdocContent'" do
header "/div[@id='fileHeader']"
content "/div[@id='bodyContent']"
end
end
puts property_data.to_xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment