开发者

how do I set a field with a duplicate name of another field in mechanize?

开发者 https://www.devze.com 2023-01-14 15:18 出处:网络
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开发

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消