python - submitting a form using mechanize, [TypeError: ListControl, must set a sequence] -


for instance,

let take facebook signup page trying submit sign form :

br.set_handle_robots(false)  br.open('http://www.facebook.com/r.php') print br.response() f in br.forms():     print f  br.select_form(nr=1)  br['firstname']='watever'  br['lastname']='kafle' br['reg_passwd__']='abhibandu' br['reg_email__']='watever@gmail.com' br['reg_email_confirmation__']='watever@gmail.com' br['birthday_month']='01' br['birthday_day']='20' br['birtday_year']='1990' br['sex']='2' br.submit()  print br.response() 

q1)i getting "typeerror: listcontrol, must set sequence" error. doing wrong ?

q2)p.s. can suggest how reload/refresh page everytime after form submission(like if want create multiple fb accounts) ?

thanks in advance!

here error message getting:

traceback (most recent call last):   file "c:\users\ninja\desktop\facebookautofill\test.py", line 15, in <module>     br['birthday_month']='01'   file "c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg\mechanize\_form.py", line 2782, in __setitem__     control.value = value   file "c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg\mechanize\_form.py", line 1977, in __setattr__     self._set_value(value)   file "c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg\mechanize\_form.py", line 1985, in _set_value     raise typeerror("listcontrol, must set sequence") typeerror: listcontrol, must set sequence 

when updated month day , year seeing post @ submitting form mechanize (typeerror: listcontrol, must set sequence)

br['birthday_month']=['01',] br['birthday_day']=['20',] br['birtday_year']=['1990',] 

i following error:

traceback (most recent call last):   file "c:\users\ninja\desktop\facebookautofill\test.py", line 15, in <module>     br['birthday_month']=['01',]   file "c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg\mechanize\_form.py", line 2782, in __setitem__     control.value = value   file "c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg\mechanize\_form.py", line 1977, in __setattr__     self._set_value(value)   file "c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg\mechanize\_form.py", line 1998, in _set_value     self._single_set_value(value)   file "c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg\mechanize\_form.py", line 2021, in _single_set_value     on, off = self._get_items(value[0])   file "c:\python27\lib\site-packages\mechanize-0.2.5-py2.7.egg\mechanize\_form.py", line 2006, in _get_items     "insufficient items name %r" % name) itemnotfounderror: insufficient items name '01' 


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -