Python Forum

Full Version: Selenium: accessing a drop-down menus without select tags
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to use Selenium to access a dropdown menu in this site. The site has no select tags.

user = os.environ['LATINDUSERNAME']
pw = os.environ['LATINDPASSWORD']

login = 'http://latindiscussion.com/forum/login/'

driver = webdriver.Chrome()
driver.get(login)
driver.find_element_by_name('login').send_keys(user)
driver.find_element_by_name('password').send_keys(pw + Keys.RETURN)
Result:
[attachment=841]

driver.find_element_by_xpath("/html[@id='XF']/body/div[@id='top']/div["
                                  "@class='p-navSticky "
                                  "p-navSticky--primary']/nav["
                                  "@class='p-nav']/div["
                                  "@class='p-nav-inner']/div["
                                  "@class='p-nav-opposite']/div["
                                  "@class='p-navgroup p-account "
                                  "p-navgroup--member']/a["
                                  "@class='p-navgroup-link "
                                  "p-navgroup-link--iconic "
                                  "p-navgroup-link--user']").click()

Result:
[attachment=842]

driver.find_element_by_xpath("/html[@id='XF']/body/div["
                             "@id='js-XFUniqueId93']
Results in an 'unable to locate element error'. (Where the id is for the newly created menu box)