I'm using Selenium in Python to open a web page and I'm trying to get the list of values from a specific dropdown list. Let's say the HTML code for the dropdown list looks like this:
<select class="mdc-select__input" name="nouveau-num" data-msisdn-loaded="0"> <option value="" selected="selected"></option>
<option value="351 8320175">351 8320175</option>
<option value="351 8652736">351 8652736</option>
<option value="351 8783295">351 8783295</option>
<option value="351 8094085">351 8094085</option>
<option value="351 8861691">351 8861691</option>
<option value="351 8271705">351 8271705</option>
<option value="351 8970191">351 8970191</option>
<option value="351 8965848">351 8965848</option>
<option value="351 8353924">351 8353924</option>
<option value="351 8988158">351 8988158</option>
</select>
And I want to retrieve all the values between <option>
tags. I tried to do a browser.page_source
which returns the HTML source of the web page and then do a regular expression (something like <option value="[0-9 ]*">
) but the result is empty. For some reason however, the HTML code above is not in the HTML page source code retrieved by Selenium. Any ideas how I can approach this differently/what is wrong with the current approach?