Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Clicking a drop down menu from web browser elements.

So I've been stuck on this one, I've done googling and have not found a solution other then switching to ASP.net. I am trying to sign out of a website, I can see that there is a drop down menu that must be clicked before hand. This is the html element I get from Inspect element and I am unable to click it through invoke click.

Code
<button class="se-menu" aria-expanded="false" aria-label="Navigation Menu">

Clicking the above should drop down a menu where sign out is an option, but I can't even click the menu.

I have tried finding it thru the class "se-menu", this gives me a null exception, I've tried the aria-label also. Does the expanded value need to be changed also? I'm unsure how to go about this now.

I've been switching different codes to click it, but this is what I have now.



Code
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All

       For Each webpageelement As HtmlElement In allelements

           If webpageelement.GetAttribute("class") = "se-menu" Then

               webpageelement.InvokeMember("click")

           End If

       Next

Huge thanks for the help 🙂
See what the sign out button actually does, you might be able just to navigate to site.com/logout or something instead. If not, you should still be able to click the button regardless as it's still in the DOM.
(Feb 16, 2018 02:54 PM)Owl Wrote:  See what the sign out button actually does, you might be able just to navigate to site.com/logout or something instead. If not, you should still be able to click the button regardless as it's still in the DOM.

I kept trying to pull the inner text from it, and it keeps pulling blanks. I tried

Element name "button"
Attribute "class"

Returns a bunch of blanks, never sees it. Not sure how it can't see it.

I tried to pull the username attribute, it also pulls up blanks -.- I feel like this is related.
I'd suggest trying selenium out, its perfect for these types of things.
Just solved this, I was able to find the sign out attribute. I guess I kept mixing up the tag name with other lines or something.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Emre_Sep 1, 2019 07:17 PM 0 134 Sep 1, 2019 07:17 PM
Last Post: Emre_
[Java] by cryptobassboostMay 20, 2019 11:49 AM 4 249 May 20, 2019 11:49 AM
Last Post: bluriy
[Python] by E V OMar 28, 2019 10:59 PM 3 107 Mar 28, 2019 10:59 PM
Last Post: Dark