how do I set a field with a duplicate name of another field in mechanize?
I am trying to submit a form with 2 fields with the same name but different type. I can identify the correct field I want by the field type or the number. Whats the best way of setting the correct开发者_开发技巧 field without iterating through all the fields?
Here is the signature of set_value() method of HTMLForm class.
set_value(value, name=None, type=None, kind=None,
id=None, nr=None,by_label=False,
# by_label is deprecated
label=None)
As you can see, you could specify type
parameter, useful in this case to select the proper field.
精彩评论