Module: Watobo::Parser::HTML

Defined in:
lib/watobo/parser/html.rb

Defined Under Namespace

Classes: Form, InputField, Links

Instance Method Summary collapse

Instance Method Details

#forms(&block) ⇒ Object


94
95
96
97
98
99
100
101
102
# File 'lib/watobo/parser/html.rb', line 94

def forms(&block)
  fs = []
  doc = Nokogiri::HTML(self.body)
  doc.css('form').each do |f|
    fo = Form.new(f)
    yield fo if block_given?
  end
  fs
end

#input_fields(&block) ⇒ Object


82
83
84
85
86
87
88
89
90
91
# File 'lib/watobo/parser/html.rb', line 82

def input_fields(&block)
  fields = []
  forms do |form|
    form.input_fields do |field|
      yield field if block_given?
      fields << field
    end
  end
  fields
end

78
79
80
# File 'lib/watobo/parser/html.rb', line 78

def links(&block)
  
end