5
웹 사이트를 열고 양식을 작성하고 양식을 제출하는 데 Python Mechanize를 사용하고 있습니다. 실제로는 매우 간단합니다. 라디오 버튼과 "선택"입력 상자가 나타날 때까지 작동합니다.TypeError : ListControl, 시퀀스를 설정해야합니다 (파이썬 오류)
br.open(url)
br.select_form(name="postmsg")
br.form['subject'] = "Is this good for the holidays? "
br.form['message'] = "I'm new to technology."
br.form['E'] = '0'
br.submit()
br.form['E'] = '0'
File "build/bdist.linux-x86_64/egg/ClientForm.py", line 2897, in __setitem__
File "build/bdist.linux-x86_64/egg/ClientForm.py", line 2092, in __setattr__
File "build/bdist.linux-x86_64/egg/ClientForm.py", line 2100, in _set_value
TypeError: ListControl, must set a sequence
왜이 오류가 발생합니까? 텍스트 상자처럼 E을 설정할 수없는 이유는 무엇입니까? (E는 라디오 버튼 임)
편집 : 웹 개발자에 따르면이 양식입니다.
Elements
Index Id Name Type Value Label Size Maximum Length State
0 subject subject text 35
2 message message textarea
3 identity identity select 1
13 action_btn hidden
14 _charset_ hidden
16 r hidden /Stocks_(A_to_Z)/Stocks_G
9 E radio 0
Checked
8 E radio 1
15 .crumb hidden 1n1Yo3MQae3
7 E radio 2
17 bn hidden 25263
6 E radio 3
5 E radio 4
4 E radio 5
12 SubmitCancel SubmitCancel submit Cancel
1 mbpostthreads threads button Check Existing Topics First
11 SubmitPost SubmitPost submit Post Message
10 SubmitPreview SubmitPreview submit Preview Message
18 yIdCoreIdUser hidden annamae41g
라디오 버튼에 HTML을 입력하십시오. – Amirshk