From 376ae24eeefb32f4927c17c55ed13c50a0c2d614 Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Fri, 11 Jun 2021 10:52:34 +0900 Subject: [PATCH] get form name --- src/mechanize/form.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mechanize/form.cr b/src/mechanize/form.cr index fb718ef..6a2226f 100644 --- a/src/mechanize/form.cr +++ b/src/mechanize/form.cr @@ -6,6 +6,7 @@ class MechanizeCr::Form getter checkboxes : Array(MechanizeCr::FormContent::CheckBox) getter enctype : String getter method : String + getter name : String property action : String def initialize(node : Node | Myhtml::Node) @@ -15,7 +16,7 @@ class MechanizeCr::Form @checkboxes = Array(MechanizeCr::FormContent::CheckBox).new @action = node.fetch("action", "") @method = node.fetch("method", "GET").upcase - #@name = node['name'] + @name = node.fetch("name", "") #@clicked_buttons = [] #@page = page #@mech = mech