Click here to Skip to main content
11,920,211 members (47,990 online)
Rate this:
Please Sign up or sign in to vote.
hi all,
I am trying to automate and get the browser to click a button but it is not working
i googled. and found these links

Talk in MSDN
Stackover flow

and many other
i want to automate Samsung website.
first select a category(Refrigerator, washer, etc...)
in that go to "SEE ALL"
in that category click on the button "VIEW ALL" and get the product list
the MSDN suggestion of object invoke is working rarely. (like 1 in 10 times)
any other suggestion please
but none of them work
Posted 8-Mar-13 0:17am
Edited 8-Mar-13 0:18am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I some how got this to work... not sure if there is a correct solution or more good one i used this

Dim el As HtmlElement = Me.webBrowser1.Document.All("Button1")
Dim obj As Object = el.DomElement
Dim mi As System.Reflection.MethodInfo = obj.[GetType]().GetMethod("click")
mi.Invoke(obj, New Object(-1) {})

And the sleep is needed i am not sure of the reason. but if you put a wait it is working.
hope this will work long enough.
please let me know if there is a better solution to do it


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 455
1 phil.o 170
2 CPallini 150
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,495
2 Sergey Alexandrovich Kryukov 3,153
3 George Jonsson 2,810
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web02 | 2.8.151120.1 | Last Updated 8 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100