Sha256: fc75d5eaf53085c478595e913599df55964e42bf6a91f426eac45effad05ccde

Contents?: true

Size: 350 Bytes

Versions: 155

Compression:

Stored size: 350 Bytes

Contents

require 'rubygems'
require 'nokogiri'

dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require File.join(dir, 'httparty')
require 'pp'

class HtmlParserIncluded < HTTParty::Parser
  def html
    Nokogiri::HTML(body)
  end
end

class Page
  include HTTParty
  parser HtmlParserIncluded
end

pp Page.get('http://www.google.com')

Version data entries

155 entries across 129 versions & 8 rubygems

Version Path
harbr-0.1.79 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.78 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.77 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.76 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.75 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.74 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.73 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.72 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.71 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.70 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.69 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.68 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.67 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.66 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.65 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.64 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.63 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.62 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.61 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.1.60 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb