use input elements with type=email in case a text input is not available
Fix Python 3 compatibility