Python Forum
Selenium: accessing a drop-down menus without select tags - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Selenium: accessing a drop-down menus without select tags (/thread-26040.html)



Selenium: accessing a drop-down menus without select tags - ClassicalSoul - Apr-19-2020

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)