I am parsing an page through Beautifulsoup in Python. The page ( link : https://services.ecourts.gov.in/ecourtindia/cases/s_order.php?state=D&state_cd=1&dist_cd=37) has a select box.
I would like to get the selected text from the select box.
Here is the HTML text after selecting an option :
<select name="court_complex_code" id="court_complex_code" style="width: 250px;height:21px;" onchange="funCourtEstChange();">
<option value="0">Select Court Complex</option>
<option value="1@2">Mumbai City Sessions Court</option>
<option value="119@1">Mumbai, City Civil Court</option><option value="121@5">Sewree, City Civil Court</option>
<option value="133@3,4">Dindoshi, City Civil Court</option>
</select>
Notice the attribute, selected
is not set to True
. It uses Javascript to obtain the selected value using the following code :
var court_complex_code=document.getElementById('court_complex_code').value;
I would like to get the selected text ( & value) through Beautifulsoup. Any idea how to do it ?