c# - Access in IFrame and SetAttribute value -
Generally I can access HTML tags and I can set my value via code;
HtmlElementCollection coll = webBrowser1.Document.GetElementsByTagName ("Input"); ("Value", "123456789");}}
/ Pre>But if the HTML input field is present in an iframe tag, then this code does not work,
and I've changed the line:
Coll = webBrowser1.Document.GetElementsByTagName ("Input");
to
var coll = webBrowser1.Document.Window.Frames [0]. Document GETElementsByTagName ("iframe")
but it still does not work Please help please. I can not go to this problem from last week.
Your code looks like this should work:
collant = webBrowser1.Document.Window.Frames [0] document.GETElementsByTagName ("iframe")
< / Pre>to
coll = webBrowser1.Document.Window.Frames [0] .documents. GetElementsByTagName ("Input"); Here is a work example ...
HTMLWindow iframe = webBrowser1.Document.Window.Frames [0]; HtmlElement input = iframe.Document.GetElementsByTagName ("input") [0]; Input.SetAttribute ("value", "test");
It clearly believes that your children have at least one IFrame element in the document and at least one input element.
Comments
Post a Comment