2

I want to search a form but get the error 'NoneType' object has no attribute

<form method="POST" action="liste.php">
          <input size="20" id="searchfield" maxlength="100" name="suche" onchange="clear_input();" accesskey="s" title="Bitte beachten Sie, dass die Suchanfrage mindestens 3 Zeichen lang sein muss!">
          <input type="submit" value="" class="gosearch">
        </form>

My python code is:

# Search the Website
formSearch = browser.get_form(action=('/liste.php'))
formSearch['suche'].value = 'Maus'
browser.submit_form(formSearch)
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
overView
  • 77
  • 2
  • 10

1 Answers1

1

The HTML shows that the action attribute is set to 'liste.php', without the leading slash. You do need to match that:

formSearch = browser.get_form(action='liste.php')
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343