mechanize icon indicating copy to clipboard operation
mechanize copied to clipboard

Parsing breaks on <hr/>

Open wichert opened this issue 13 years ago • 2 comments

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.

wichert avatar Dec 04 '12 14:12 wichert

Interestingly changing <hr/> to <hr /> (ie adding a space before the slash) seems to work around this bug.

wichert avatar Dec 04 '12 14:12 wichert

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.

zigdon avatar Mar 05 '15 22:03 zigdon