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
httparty-0.22.0 examples/nokogiri_html_parser.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
study_line-0.2.7 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
study_line-0.2.6 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
study_line-0.2.5 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
study_line-0.2.4 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
study_line-0.2.3 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
study_line-0.2.2 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
study_line-0.2.1 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
study_line-0.2.0 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/nokogiri_html_parser.rb