I need to select an element from a dropdown menu.
For example:
<div class="col-sm-4 col-lg-2">
<label for="rangeFilter" class="sr-only">Date Range</label>
<select class="selectpicker" id="rangeFilter" data-none-selected-text="Range" name="range">
<option value="">View by</option>
<option value="6month">6 months</option>
<option value="1year">1 Year</option>
<option value="2year">2 Year</option>
<option value="all">All time</option>
</select>
</div>
but i have always some kind of error.
My code is so easy:
driver = webdriver.Chrome("D:\Python27\selenium\webdriver\chrome\chromedriver.exe")
driver.implicitly_wait(5)
driver.maximize_window()
driver.get("https://ispspeedindex.netflix.com/country/norway/")
time.sleep(15)
select = Select(driver.find_element_by_id('rangeFilter'))
select.select_by_visible_text('All time')
but it don´t work. It appears a message about "element not visible: Element is not currently visible and may not be manipulated"
Traceback (most recent call last):
File "scraping.py", line 23, in <module>
select.select_by_visible_text('All time')
File "D:\Python27\lib\site-packages\selenium\webdriver\support\select.py", line 120, in select_by_visible_text
...
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible: Element is not currently visible and may not be manipulated
any idea? i was trying with some fixes from another stackoverflow questions but i didn´t find the way...