i am building a crawler and i am using Mechanize. I wish to click on a radio button. How do i do that ?
Like for example there are two radio buttons say ‘A’ and ‘B’.
The website automatically selects B, but i want ‘A’ using Mechanize in ruby. I am also using the latest version on Mechanize.
There are a couple of ways to do this. Probably the best would be to use the radio button’s
nameorid:You could also do something like this:
Which is more succinct, but more likely to break (if for instance you were to change the design of your form).