To log out, I am trying to use Puppeteer to select and click on a dropdown menu item.
This particular menu requires hovering over it with a mouse in order to reveal its options, as opposed to clicking directly.
When attempting to copy the selector for the dropdown menu area, I have two possible outcomes:
#ds-desktop-nav-main > div > div > ul.ds-nav-toolbar > li.ds-btn-group.ds-dropdown-group.ds-my-xxx-dropdown.show-logged-in > a > span
or
#ds-desktop-nav-main > div > div > ul.ds-nav-toolbar > li.ds-btn-group.ds-dropdown-group.ds-my-xxx-dropdown.show-logged-in > a
The selector for the logout button is:
<a href="/users/sign_out" class="ga-tracking" data-ga-action="user" data-ga-category="main_nav" data-ga-label="LOGOUT">Logout</a>
All of this is contained within a UL class with LI elements.
Below is the HTML code for the element that needs to be hovered over in order to activate the dropdown:
<a href="/users/current" class="ga-tracking" data-ga-category="main_nav" data-ga-action="user" data-ga-label="PROFILE"><span class="user-icon"></span></a>