mechanize select form using id

后端 未结 7 1696
天命终不由人
天命终不由人 2020-12-18 18:31

I am working on mechanize with python.

The

7条回答
  •  醉梦人生
    2020-12-18 18:49

    Improving a bit on python412524's example, the documentation states that this is valid as well, and I find it a bit cleaner:

    for form in br.forms():
        if form.attrs['id'] == 'sblock':
            br.form = form
            break
    

提交回复
热议问题