I am using selenium with python to try and click through a dropdown menu. However the options the dropdown menu produces are not visible in the source code of the webpage.
I have not been able to find a way that lets me select an item in the dropdown by name.
So far I am able to login and click on the menu to produce the dropdown as such:
courses = driver.find_element_by_link_text("Select a course...").click()
However after this, I am not sure how to access and click the elements produced by the above click.
Here is a snippet of the HTML that activates the dropdown.
<a class="d2l-menuflyout-opener d2l-clickable" onclick="return false;" aria-haspopup="true">
<span class="d2l-menuflyout-text d2l-menuflyout-emphasis">Select a course...</span><span class="d2l-menuflyout-arrow d2l-menuflyout-arrow-open d2l_1_41_179"></span><span class="d2l-menuflyout-arrow d2l_1_40_548 d2l-menuflyout-arrow-closed"></span>
Here is a screenshot of what the menu looks like after the .click() call.
Once the menu opens, I am not sure how to select the one I want since I don't know how the values or id's of the options are stored as it is not in the source code.
element = WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.ID, "myDynamicElement"))but my problem is I don't know how to find the link I want to click since it is not visible in the HTML.. - Carlos G. Olivervisibility_of_element_locatedinstead ofpresence_of_element_locatedwithxpathin my answer . - NarendraR