1

First time poster. I'm slamming my head against my desk trying to figure out how I can hover over the utilities drop down menu(pic 1) using selenium. I've tried inspecting the element on google chrome and when I do, this appears(pic 2). I've tried copying the xpath from what is listed there but have no luck. This is what copies - //*[@id="container-menu"]/div/div/div/div/ul/li[5]/a

When I try to use that it throws an error because it has no idea what all that is that follows the brackets I'm assuming.

I've spent time on google and YouTube trying to find a fix ranging from Action chains to trying to use the href but perhaps I'm doing it wrong. I'm self taught and just usually go learn what I need to do as its needed. If anyone could help tell me what I'm doing wrong and help point me in the right direction that would be greatly appreciated.

My end goal is to have it hover over "utilities" and then the drop down menu appears then i would like it to click on "Manage Structure" to advance my script to the next webpage that im trying to access.

Thanks in advance!

This is the utilities menu item I am trying to hover over using selenia:

This is the utilities menu item I am trying to hover over using selenia

inspect window on utilities:

inspect window on utilities

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
mpolzin
  • 11
  • 1

1 Answers1

1

The first thing you need is to move it to the element. I only know selenium in R, so this is R code, but you should be able to translate it to python selenium.

I think it would be something like:

utilities <- remDr$findElement(using="xpath", value="//a[@class='dropdown-toggle']")
remDr$mouseMoveToLocation(webElement=utilities)

this will only work if dropdown-toggle is a unique class and isn't found somewhere else in the code on the page

You'd then click on the link. Probably something along the lines of:

manage <- remDr$findElement(using="xpath",value="//a[text()='Manage Structure']")
manage$clickElement()

This should hopefully at least point you in the right direction. The other thing to check for is an "iframe" - if this is within an iframe then you'd have to switch to that first. I think you can just search the code for "iframe" and see if it pops up.

missgwolf
  • 356
  • 1
  • 11
  • So i tried your advice, but I'm still struggling to get it to work, so when I look at the element for the utilities dropdown pane, the actual element is
  • – mpolzin Nov 25 '21 at 16:19
  • Is the website proprietary or could you add the link? – missgwolf Nov 29 '21 at 00:56