How can I select an element from this drop down menu in Python/Selenium?
Question: I've looked through a few solutions to select drop down elements, but none of
them are working for me.

This is the html for the dropdown.

    
    
    <div class="goog-inline-block goog-flat-menu-button" role="button" style="-moz-user-select: none;" tabindex="3" aria-haspopup="true">
        <div class="goog-inline-block goog-flat-menu-button-caption">Resolved</div>
        <div class="goog-inline-block goog-flat-menu-button-dropdown">&nbsp;</div>
    </div>
    

I've tried finding the dropdown by xpath and link text with no success.

EDIT: Here's the code I'm using

    
    
    import contextlib
    import selenium.webdriver as webdriver
    import selenium.webdriver.support.ui as ui
    from selenium.webdriver.common.keys import Keys
    import re
    with contextlib.closing(webdriver.Firefox()) as driver:
        driver.get("https://websitename.com/#ticket/123456")
        wait = ui.WebDriverWait(driver, 30)
        wait.until(lambda driver: driver.find_element_by_xpath("//div[@class='goog-inline-block goog-flat-menu-button"))
        driver.find_element_by_xpath("//div[@class='goog-inline-block goog-flat-menu-button").click()
        driver.find_element_by_xpath("//div[@class='goog-inline-block goog-flat-menu-button").send_keys("R")
        wait6 = ui.WebDriverWait(driver, 30)
    

The code is supposed to change the selected drop down list element from
assigned to resolved.


Answer: What xpath did you try?

The simplest I can see is:

    
    
    driver.find_element_by_xpath("//div[contains(@class, 'goog-flat-menu-button-dropdown')]")
    

However I'm a little confused about your request about 'selecting' as this
isn't a `select` element so I'm sorry, I'm not sure I can help there.

Try the given below method with the help of CSS Selector

    
    
    driver.find_element_by_cssselector(".goog-flat-menu-button > .goog-flat-menu-button-dropdown").click();
    

I am sure the above CSS Selector will work.

