How to select a drop-down menu value with Selenium, Python

I need, click a dropdown menü element. But I'm new Selenium Webdriver and I cant find anything

<div class="sort-fltr-cntnr"><select>
<option value="SCORE">Önerilen</option>
<option value="PRICE_BY_ASC">En Düşük Fiyat</option>
<option value="PRICE_BY_DESC">En Yüksek Fiyat</option>
<option value="MOST_RECENT">En Yeniler</option>
<option value="BEST_SELLER">Çok Satanlar</option> ....

Its my code:

dropdown = self.driver.find_element(By.CSS_SELECTOR, "select")
element=dropdown.find_element(By.XPATH, "//option[. = 'Önerilen']")
self.driver.execute_script("arguments[0].click();", element)
time.sleep()
dropdown.find_element(By.XPATH, "//option[. = 'En Düşük Fiyat']").click()

An given a error:

selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //option[. = 'Önerilen']


from Recent Questions - Stack Overflow https://ift.tt/3FRcnaT
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Object oriented programming concepts (OOPs)

Spring Webflux : How to return HTTP 200 response with body when the called service returns HTTP 201 without body with WebClient?