Python Forum
Selenium: accessing a drop-down menus without select tags
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium: accessing a drop-down menus without select tags
#1
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:
   

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:
   

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)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  To select only the latest value with Selenium codessu 2 405 May-16-2020, 03:51 AM
Last Post: codessu
  How to get visible text of Select Drop down ankitjindalbti 2 873 Jun-03-2019, 12:35 AM
Last Post: ankitjindalbti
  Select Drop down is not working properly ankitjindalbti 3 795 Jun-02-2019, 07:37 PM
Last Post: metulburr
  Getting error when accessing elements in a modal window of an webpage using selenium sumandas89 3 4,482 Jul-13-2018, 10:44 AM
Last Post: mlieqo
  Unable to select iframe using selenium endejoli 1 1,475 Jan-11-2018, 05:13 PM
Last Post: j.crater
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 1,658 Nov-03-2017, 08:41 PM
Last Post: metulburr
  Click on a Drop-down button with selenium Python AcszE 3 4,296 Oct-25-2017, 03:13 PM
Last Post: vardhhan
  [Selenium] Xpath Drop Down Use Variable digitalmatic7 3 2,500 Oct-07-2017, 01:45 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020