Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 7-Mar-13 23:18pm
v2

1 solution

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

VB
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")
threading.thread.sleep(2000)
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

Thanks
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900