내 작은 기계화 코드를 얻었다되는 HTML의 폼 입력을 무시합니다 :파이썬 기계화는
br.open('http://tumblr.com/customize');
print br.response().read()
print br.form['edit_tumblelog[cname]'] # there definitely is edit_tumblelog
# and br.form['edit_tumblelog[enable_cname]'] works fine
출력 : 내가 잘못
...
<br/>
<input type="text" class="text_field" style="width:275px; min-width:0px;
margin:6px 0px; border:solid 1px #d2d2d2;
"
name="cname" id="cname"
onchange="form_changed = true;"
value="blog.yay.com"
/>
...
Traceback (most recent call last):
File "/tmp/temp_textmate.W6p5gh", line 51, in <module>
print br.form['edit_tumblelog[cname]']
File "/Library/Python/2.6/site-packages/ClientForm-0.2.10-py2.6.egg/ClientForm.py", line 2891, in __getitem__
File "/Library/Python/2.6/site-packages/ClientForm-0.2.10-py2.6.egg/ClientForm.py", line 3222, in find_control
File "/Library/Python/2.6/site-packages/ClientForm-0.2.10-py2.6.egg/ClientForm.py", line 3306, in _find_control
ClientForm.ControlNotFoundError: no control matching name 'edit_tumblelog[cname]'
을 뭐하는 거지?
컨트롤을 식별하는이 대괄호 표기법에 익숙하지 않습니다. 문서화 할 수 있도록 URL을 문서로 제공 할 수 있습니까? 필자는'br.select_form (name = 'edit_tumblelog')'(폼의 이름이라고 가정)을 사용하고'br [ 'cname']'을 사용했지만, 문서를 찾을 수 있다면 대괄호 표기법이 흥미롭게 보입니다 그것을 위해 그것을 제대로 작동하게 - 감사합니다! –