I am having problem with filling text area and click on the button using my c# code... please give me example if you have I dont care if you are using webbrowser or watin or whatever...
TEXT AREA:
BUTTON:
this is what I have tried so far but it is not working..
TEXT AREA:
Code:
<textarea class="textarea" placeholder="Say something" style="overflow: hidden;"></textarea>
BUTTON:
Code:
<div class="comment-submit-container">
<button class="comment-submit" type="submit">Post Comment</button>
<img class="comment-submit-loading" width="16" height="16" src="ling was here" alt="">
</div>
this is what I have tried so far but it is not working..
Code:
webBrowser1.DocumentText = "text with classes";
webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
foreach (HtmlElement txt in webBrowser1.Document.GetElementsByTagName("textarea"))
{
if (txt.GetAttribute("ClassName") == "textarea")
{
txt.SetAttribute("value", "adsasdassd");
// MessageBox.Show("uneseno");
}
}
foreach (HtmlElement btn in webBrowser1.Document.GetElementsByTagName("button"))
{
if (btn.GetAttribute("ClassName") == "comment-submit")
{
btn.InvokeMember("Click");
MessageBox.Show("kliknuto");
}
}
}
Last edited: