Extracting Value from Response

Team - I am unable to extract the value from the below code. Basically, when I select India, number “8” will send to the server. This number will vary based on the user profile. For example, user 1 will select India from the dropdown, it will send as “8” in the request (Actually this user can see all below values in the dropdown). When user 2 selects India, it will send as “4” in the request (This user can see only 6 values and out of 6, 5th value is India). All users will choose only “India” from the dropdown.

<option value="0">Albania</option>
<option value="1">Afghanistan</option>
<option value="2">Bhutan</option>
<option value="3">Belgium</option>
<option value="4">Canada</option>
<option value="5">Denmark</option>
<option value="6">France</option>
<option value="7">Germany</option>
<option value="8">India</option>
<option value="9">United Kingdom</option>
<option value="10">United States of America</option>

Can someone help me?

Try the k6/html API, it allows you to parse the HTML and use CSS selectors to find elements.