Add the possibility to fetch input from a string rather than a webpage
Reported by Peter Szinek | November 29th, 2008 @ 08:27 PM | in 0.4.1
Something like
ruby @@@ fetch :source => :string, '
hey
Comments and changes to this ticket
-
Peter Szinek November 29th, 2008 @ 08:27 PM
- State changed from new to open
-
Peter Szinek November 29th, 2008 @ 08:29 PM
- Milestone set to 0.4.1
-
Peter Szinek December 9th, 2008 @ 11:58 PM
- State changed from open to resolved
I think this is what you wanted:
require 'rubygems' require 'scrubyt' garbage = <<-SZ <html> <body> <table> <tr><td>1</td></tr> <tr><td color="red">2</td></tr> <tr><td>3</td></tr> </table> </body> </html> SZ google_data = Scrubyt::Extractor.define do fetch nil, :html => garbage redcell "//td[@color='red']" end puts google_data.to_xml
outputs
2
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A simple to learn and use, yet powerful web scraping toolkit written in Ruby.