perlwww-mechanize-firefox

WWW::Mechanize::Firefox select element with no name


how to select option element from select only with class using WWW::Mechanize::Firefox.

For example:

<select class="alabala">
<option value="a1">a1</option>
<option value="a2">a2</option>
<option value="a3">a3</option>
<option value="a4">a4</option>
<option value="a5">a5</option>
<option value="a6">a6</option>
</select>

How to select a2?

Thanks


Solution

  • The same way you would set any other value in the form:

    $mech->field(".alabala", "a2");