I'm trying to programmatically open the hidden div containing the bitrate information in this web page: http://www.myfreemp3.cc/mp3/jamie+jones+cookie+monster
I'm using an hidden WebBrowser, in which i'm injecting and executing this code:
$("[class^='bitrate butt bit']")[0].click();
but it doesn't work.
If you put the code line above in the Firefox debugger's console it works...
This is my code:
webBrowser.Navigate("http://www.myfreemp3.cc/mp3/jamie+jones+cookie+monster");
waitTillLoad(webBrowser); //wait till the document finish to load
string script = "function click_checkButtons () { $(\"[class^='controll_button playlist_button']\").click(); }";
HtmlElement head = webBrowser.Document.GetElementsByTagName("head")[0];
HtmlElement scriptEl = webBrowser.Document.CreateElement("script");
IHTMLScriptElement element = (IHTMLScriptElement)scriptEl.DomElement;
element.text = script;
head.AppendChild(scriptEl);
webBrowser.Document.InvokeScript("click_checkButtons");