Here is my code: from robobrowser import browser
url = 'http://diesel.elcat.kg/index.php?act=Login&CODE=00'
url3 = 'http://diesel.elcat.kg/index.php?act=post&do=reply_post&f=178&t=233500064'
m = browser.RoboBrowser()
m.open(url)
# SIGNING IN(form1)
form1 = m.get_form(action='https://diesel.elcat.kg/index.php?act=Login&CODE=01')
form1['UserName'].value = 'Username'
form1['PassWord'].value = 'Password'
m.submit_form(form1)
# FINISHED SIGNING IN(everything worked)
# GOING TO THE PAGE WHERE FORM IS LOCATED
m.open(url3)
# Can't submit this form
form2 = m.get_form(action="http://diesel.elcat.kg/index.php?")
form2['Post'].value = 'up'
m.submit_form(form2)
I can sign in to the website so form1 works, but when I try in this case leave a comment(up), form2 does not work.I am keep getting either InvalidSubmit error either Bad Request error. Code of form1 and code of form2 seem to be the same, but one works and another does not. I am using python3.5 and robobrowser, and I am using Mac OS if that's gonna help. Thank you in advance. Here is my traceback:
Traceback (most recent call last):
File "/Users/bkkadmin/Desktop/Daniiar/upper/test2.py", line 18, in <module>
m.submit_form(form)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/robobrowser-0.5.3-py3.5.egg/robobrowser/browser.py", line 339, in submit_form
payload = form.serialize(submit=submit)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/robobrowser-0.5.3-py3.5.egg/robobrowser/forms/form.py", line 226, in serialize
include_fields = prepare_fields(self.fields, self.submit_fields, submit)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/robobrowser-0.5.3-py3.5.egg/robobrowser/forms/form.py", line 154, in prepare_fields
raise exceptions.InvalidSubmitError()
robobrowser.exceptions.InvalidSubmitError