I need to get all of the attributes from my webbrowser.currently,I am using GetAttribute() but this way,I need to know the name of the attributes. Imagine I do not know what is in my webbrowser. My C# code:
StringWriter strWriter = new StringWriter();
XmlWriter xWriter = XmlWriter.Create(strWriter, new XmlWriterSettings() { Indent = true });
xWriter.WriteStartElement("Items");
foreach (HtmlElement el in webBrowser1.Document.GetElementsByTagName("TEXTAREA"))
{
xWriter.WriteStartElement("Item");
xWriter.WriteElementString("GUID", el.Id);
xWriter.WriteElementString("Type", el.GetAttribute("type").ToUpper());
xWriter.WriteElementString("Name", el.Name);
xWriter.WriteElementString("Value", el.GetAttribute("value"));
xWriter.WriteElementString("MaxLength", el.GetAttribute("maxlength"));
xWriter.WriteEndElement();
}
I have searched a lot but I did not find any thing useful.