i want to fill in a form from a website using following code :
import mechanicalsoup
browser = mechanicalsoup.StatefulBrowser()
browser.open("Web page url")
browser.follow_link("login")
browser.get_url()
browser.select_form('div[class="p30"]')
browser.get_current_form().print_summary()
>>> <input class="form-input" id="mail" type="text"/>
>>> <input class="form-input" id="pass" type="password"/>
as you can see .print_summary() return exact fields that i want to assign values to, but there is no attribute "name" for any of them so i can't change it. I've read Mechanicalsoup tutorial and the form in it has that attribute "name":
<input name="custname"/>
<input name="custtel" type="tel"/>
<input name="custemail" type="email"/>
and it can simply be changed using:
browser["custname"] = "Me"
browser["custtel"] = "00 00 0001"
browser["custemail"] = "nobody@example.com"
i'm new to mechincalsoup so any help is greatly appreciated.