0
도시의 상품 평균 가격을 얻기 위해 양식을 채워 넣으려고합니다.Mechanize : TypeError : 'NoneType'객체가 항목 할당을 지원하지 않습니다.
Traceback (most recent call last):
File "Trip cost calculator/trip costs calculator.py", line 50, in <module>
br.form['menu_dispatch_form'] = 'Washington, DC, United States'
TypeError: 'NoneType' object does not support item assignment
는 어떤 형태로 이름이 없어하지만 난 대신 양식 ID를 사용할 수 있습니다 생각 :
basket = br.open('http://www.numbeo.com/cost-of-living/')
read_it = basket.read()
# Select form
for form in br.forms():
print '%r %r %s' % (form.name, form.attrs.get('id'), form.action)
for control in form.controls:
print ' ', control.type, control.name, repr(control.value)
br.form['menu_dispatch_form'] = 'Washington, DC, United States'
br.submit()
이 오류를 받고 있어요. 나는이 도움이되었다는 것을 website 발견했지만 자신의 예와 달리 나는 을 br.form[]
에 넣을 필요가 없습니다. 누구가 무슨 일이 일어나는지 알아?