May 30, 2013 I'm trying to select an option in the web page with webBrowser control. I know how to select a value, here is my code: webBrowser.Document.GetElementsByTagName('select').GetElementsByName('dateByMonth')0.SetAttribute('value', '2013-05'); But there is one problem, the website automatically refreshes when the value is changed. Feb 16, 2013 WebBrowser Element Events and Values. Marc Clifton. I have used web browser control just to show some html text. I tried to achieve one thing but could not do it. Suppose i have one webbrowser control and one button called 'insert button' on my winform apps. When user will click on button called 'insert button' then a new button will appear.
I am trying to automate a form being filled out with the webbrowser control for VB.NET
The problem is that there is two comboboxes, the second having its values generated depending on the first one.I can get the correct index to be selected for the first combobox, but for the second the values are never generated. I have to manually select another value for the first combobox and then the second is populated.
I have tried setting/removing focus of the first combobox to try and get the second to populate, but that has not worked.
My current code is:
The HTML code that I am playing with is (cut down):
Mathemats
MathematsMathemats1,0414 gold badges18 silver badges30 bronze badges
1 Answer
You might try the following:
curElement.SetAttribute('Value', 'Value You Want')
curElement.RaiseEvent('onchange')
user3489343user3489343
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged htmlvb.netwebbrowser-control or ask your own question.
I'm using Delphi and WebBrowser componenet to navigate a html page . the page have a Combobox . is there any way to call the OnChange event ?
The ComboBox is like this :
Also , i have used this code :
But it change the value only.
KermiaKermia1,78510 gold badges52 silver badges103 bronze badges
2 Answers
to execute the
onchange
event you can use the execScript
methodcheck this sample
for more info check this excellent article
RRUZRRUZ125k13 gold badges313 silver badges445 bronze badges
Inspired by the response. NET have been using the structures below:
or
cale_b20.4k6 gold badges51 silver badges87 bronze badges
Kenan İLGÜNKenan İLGÜN