Created
January 5, 2009 02:44
-
-
Save jaigouk/43238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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