Saturday 15 May 2010

http - TypeError: ListControl, must set a sequence (python error) -


I am using Python mechanisms to open a website, filling out a form and submitting that form. It really is very simple, it works until I come in the radio button and the "selection" input box.

  br.open (url) br.select_form (name = "postmsg") br.form ['subject'] = "Is it good for the holidays?" Br.form ['message'] = "I'm new to technology." Br.form ['E'] = '0' br.submit () br.form ['e'] = '0' file "Build / BDIS.Lennx-X86_64 / Eggs / ClientForm UP", in line 2897, __setitem__ file "build / bdist.linux-x86_64 / egg / clientform.py", __setattr__ file in the line _______ "build / bdist.linux-x86_64 / egg / clientform.py", line 2100, _set_value in type error: list control, Set a sequence  

Why did I get this error? Why can not I set e like a text box? (E is a radio button)

EDIT: This is according to web developer.

  element index id name type value label size maximum length state 0 subject subject text 35 2 message message text recognition 3 identification identity 1 13 action_btn hidden 14 _charset_ hidden 16r hidden / stock_ (a_tov_j) / Stocks_g 9e radio 0 was checked 8 e radio 1 15 .Chrome hidden 1 N 1 U3 MQ 3 7 E radio 2 17 bn hidden 25263 6 e radio 3 5 e radio 4 4 e radio 5 12 Submit SubmitSendal Cancel Cancel 1 mbpostthreads Thread Button Check current topics first 11 SubmitPost SubmitPost Submit Post Messages 10 Radios Free Online - United States - Archive for Europe Area - Radio Button and Checkbox Different behaviors are different elements, depending on their name and ID .  

If the item has the same name, try doing this:

  br.find_control (name = "E"). Value = ["0"]  

Another option is:

  form.find_control (name = "E", kind = "list"). And finally, it can work:  
  br ["e"] = ["0"]  

(I have not done mechanization in a while, so I do not remember at all).


No comments:

Post a Comment