I am working with robobrowser to login to a website.
The problem I have is that the login page has 2 forms both with the same action, but with different names.
<form action="/login" name="changedomain">
...
</form>
The second form is:
<form action="/login" name="signin">
...
</form>
My python code looks like:
import re
from robobrowser import RoboBrowser
browser = RoboBrowser(history=True, parser="lxml")
browser.open("http://example.com")
form = browser.get_form()
The problem is if I use:
form = browser.get_form()[1]
I get an BadRequestKeyError, and I can't find any documentation on how to locate the form by name. The only documentation says to use the action, but the forms have the same action attribute. any suggestions are welcome.