Sha256: 210ba13bc84b72fce706f3d5499ae04313b9bad67a6dbffc9d05baf339932489

Contents?: true

Size: 400 Bytes

Versions: 61

Compression:

Stored size: 400 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
  SupportedFormats.merge!('text/html' => :html)

  def html
    Nokogiri::HTML(body)
  end
end

class Page
  include HTTParty
  parser HtmlParserIncluded
end

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

Version data entries

61 entries across 60 versions & 9 rubygems

Version Path
alloy_sdk-0.1.0 vendor/bundle/ruby/2.6.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
alloy_sdk-0.1.0 vendor/bundle/ruby/3.0.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
httsoiree-0.13.3 examples/nokogiri_html_parser.rb
allegro_api_client-0.0.9 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
httparty-0.13.3 examples/nokogiri_html_parser.rb
allegro_api_client-0.0.8 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
allegro_api_client-0.0.7 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
httparty-0.13.2 examples/nokogiri_html_parser.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
allegro_api_client-0.0.6 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
allegro_api_client-0.0.5 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
allegro_api_client-0.0.4 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
allegro_api_client-0.0.3 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
allegro_api_client-0.0.2 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
allegro_api_client-0.0.1 gems/ruby/2.1.0/gems/httparty-0.13.1/examples/nokogiri_html_parser.rb
httsoiree-0.13.1.1 examples/nokogiri_html_parser.rb
httsoiree-0.13.1 examples/nokogiri_html_parser.rb
httparty-enterprise-edition-0.13.1.1 examples/nokogiri_html_parser.rb
httparty-enterprise-edition-0.13.1 examples/nokogiri_html_parser.rb
httparty-0.13.1 examples/nokogiri_html_parser.rb