mechanize
mechanize copied to clipboard
Parsing breaks on <hr/>
I have a xhtml form which looks roughly like this:
<form action="session.html">
<fieldset class="concise">
<label>E-mail address <input type="email" /></label>
<label>Password (<a href="#">I forgot my password</a>) <input type="password" /></label>
<fieldset class="comprehensive">
<label><input type="checkbox" /> Remember password </label>
</fieldset>
<hr/>
<p class="buttonBar">
<button type="submit" name="next" value="previous" class="floatBefore back">Previous</button> <button type="submit" name="next" value="next" class="floatAfter">Next</button>
</p>
</fieldset>
</form>
The submit button on this form is not found by mechanize. This appears to be due to the <hr/> element: as soon as I remove that the submit button is found correctly.
Interestingly changing <hr/> to <hr /> (ie adding a space before the slash) seems to work around this bug.
same thing happens with <br/> and <br /> here https://gist.github.com/zigdon/c91e323a47676dbc6065
The first two hidden inputs are found, the two text fields are not, the last two inputs (checkbox and submit) are.