fix parse input without type attribute

master
Anton Maminov 2021-08-18 17:50:03 +03:00
parent 2d6f22f8b9
commit f3c0af6460
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ WebMock.stub(:get, "example.com/check_form").to_return(body: <<-BODY
<body>
<form action="post_path" method="post" name="sample_form">
<!-- fields -->
<input type="text" name="name">
<input name="name">
<input type="text" name="email">
<input type="hidden" name="userid" value="12345">
<input type="password" id="pass" name="password">

View File

@ -65,7 +65,7 @@ class MechanizeCr::Form
private def parse
@node.css("input").not_nil!.each do |html_node|
html_node = html_node.as(Lexbor::Node)
type = (html_node["type"] || "text").downcase
type = (html_node["type"]? || "text").downcase
case type
when "checkbox"
checkboxes << FormContent::CheckBox.new(html_node, self)