Imagine you have a website:
<div class="formfonttitle">Wireless - General</div>
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px"><img src="/images/New_ui/export/line_export.png"></div>
<div class="formfontdesc">Set up the wireless related information below.</div>
<table width="99%" border="1" align="center" cellpadding="4" cellspacing="0" id="WLgeneral" class="FormTable">
<tr id="wl_unit_field">
<th>Frequency</th>
<td>
<select name="wl_unit" class="input_option" onChange="_change_wl_unit(this.value);">
<option class="content_input_fd" value="0" >2.4GHz</option>
<option class="content_input_fd" value="1" selected>5GHz</option>
</select>
</td>
</tr>
You are attempting to choose "2.4GHz" using xpath. However, the default option is "5GHz." You are executing this task through a Python script with the help of the Selenium webdriver.
Your approach involves:
elements = mydriver.find_element_by_xpath("//div[@class='wl_unit']")
title = elements[1].find_elements_by_xpath(".//div[@class='content_input_fd']")
Unfortunately, the above method is not producing the desired outcome.