Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Add the possibility to fetch input from a string rather than a webpage

#4

Something like

ruby @@@ fetch :source => :string, '

hey


Reported by Peter Szinek · November 29th, 2008 @ 08:27 PM

State: resolved
Milestone: 0.4.1
Assigned to: Peter Szinek Peter Szinek

Activity

  1. Peter Szinek
    Peter Szinek
    • State changed from new to open

    November 29th, 2008 @ 08:27 PM

  2. Peter Szinek
  3. Peter Szinek
    Peter Szinek
    • 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
    
    

    December 9th, 2008 @ 11:58 PM

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.