1

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");
MananaBumBum
  • 13
  • 1
  • 4
  • Try to play around with the Interner explorer options. Get into Tools => Internet Options and try reducing the security etc. – ilans Oct 05 '14 at 17:25

2 Answers2

1

This is due to that WebBrowser is basic component of older IE, you can enter settings in registry to run your webbrowser to use latest internet explorer which you have in your computer, Take a look at this link

Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?

Community
  • 1
  • 1
Padhu
  • 1,590
  • 12
  • 15
0

Have you tried appending to document.body instead of document.head?

...Tom

Tom Robinson
  • 1,850
  • 1
  • 15
  • 14