I'm currently working in an application that has to navigate a webpage and recollect data about products, prices, ... with webbrowser object in .net 3.5.
The problem is that the page has some fields with a suggest script in ajax, and I can't simply modify the innerText property because the script also saves codes in a hidden input field.
I need a way to simulate the typing in that field and then send the "Enter" key, or launch the ajax script and then send the "Enter" key, or any better ways to do this.
Use Watin
Then you can use this solution.
To submit a form or run a script you can do this: If you know the script name you can use InvoekScript of Document object:
myWebBrowser.Document.InvokeScript("script-name",null);
the second argument is an array of objects to pass parameters values.
if you know the name of an element that it's click event fires the script you can do this:
HtmlElement element=myWebBrower.Document.GetElementById("element-name")[0];
element.InvokeMember("click");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With