S
snailigrape
#i'm new to ruby. i download the machanize gem and install it.
in machanize.rb , root_node has an each_recursive method,but i can't
fine the definition in docs. who can tell me what to do,thanks in
advance.
def self.extract_all_from(root_node)
fields = []
root_node.each_recursive {|node|
if (node.name.downcase == 'input' and
%w(text password hidden checkbox radio
int).include?(node.attributes['type'].downcase)) or
%w(textarea option).include?(node.name.downcase)
fields << Field.new(node.attributes['name'],
node.attributes['value'])
end
}
return fields
end
in machanize.rb , root_node has an each_recursive method,but i can't
fine the definition in docs. who can tell me what to do,thanks in
advance.
def self.extract_all_from(root_node)
fields = []
root_node.each_recursive {|node|
if (node.name.downcase == 'input' and
%w(text password hidden checkbox radio
int).include?(node.attributes['type'].downcase)) or
%w(textarea option).include?(node.name.downcase)
fields << Field.new(node.attributes['name'],
node.attributes['value'])
end
}
return fields
end