Ok, I have a very frustrating problem. I am parsing a webpage and need to have it execute the javascript in order to get the information I want.
Form f = new Form();
WebBrowser w = new WebBrowser();
w.Navigate(url);
f.Controls.Add(w);
f.ShowDialog();
HtmlElementCollection hc = w.Document.GetElementsByTagName("button");
This works and I'm able to get the button elements fine, but then I get a popup everytime I run this. Very annoying. The popup is javascript based and I need to run Javascript to get the button element info. Here is the script for the popup.
<script>
var evilPopup = (getCookieVar("markOpen","PromoPop") == 1);
if (evilPopup != 1)
{
PromoPop = window.open('/browse/info.aspx?cid=36193','Advertisement', 'width=365,height=262,screenX=100,screenY=100');
if (PromoPop)
{
PromoPop.blur();
window.focus();
setCookieVar("markOpen","PromoPop","1");
}
}
</script>
I tried in vane to possibly add a cookie to the Forms.Webbrowser control but got frustrated and gave up. I tried setting the NoAllowNavagate property and everything else to no avail.
Can anyone help? Also, there a way to get the DomDocument info from the Console.App without having to open a form?
Thanks