home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Netflix plugin (NetflixAlpha)
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="te3hpurp" data-source="post: 1065794" data-attributes="member: 82806"><p>Okay here it goes.</p><p>It is plain Document completed event receiver. At the beginning there is </p><p>chek if document really is complete. It is quite important to check, cos </p><p>event appears many times before document is ready.</p><p>When it is. We go on. First we select profile, </p><p>and when we get new document complete event there is (if try again button appears) html element</p><p>which class name contains "errorBtn". Actually it contains also "tryBtn in same class name</p><p>but it is not a problem.</p><p></p><p>So if we find try again button we just invoke it.</p><p></p><p> </p><p>[CODE] </p><p>private void webBrowser1_DocumentCompleted(System.Object sender, WebBrowserDocumentCompletedEventArgs e)</p><p> {</p><p> if (this.webBrowser1.ReadyState != WebBrowserReadyState.Complete){</p><p> return;}else{</p><p> System.Diagnostics.Debug.Print("COMLETED !!");</p><p> if (e.Url.Equals(webBrowser1.Url))</p><p> {</p><p> HtmlDocument document = webBrowser1.Document;</p><p></p><p> //parse profiles</p><p> foreach (HtmlElement ele in document.All)</p><p> {</p><p> // elementofpage.Add(ele);</p><p> if (ele.InnerHtml != null)</p><p> {</p><p> if (ele.GetAttribute("className").ToString().Contains("ng-binding"))</p><p> {</p><p> profiles.Add(ele);</p><p> }</p><p> }</p><p> }</p><p></p><p> // Select profile</p><p> if(profiles.Count>0){</p><p> //Here can check which profile to select</p><p> profiles[0].InvokeMember("click");</p><p> }</p><p></p><p> profiles.Clear();</p><p></p><p> // Bypass 'Something went wrong, try again ' try button</p><p> foreach (HtmlElement ele in document.All)</p><p> {</p><p> </p><p> if (ele.InnerHtml != null)</p><p> {</p><p> if (ele.GetAttribute("className").ToString().Contains("errorBtn"))</p><p> {</p><p> // profiles.Add(ele);</p><p> ele.InvokeMember("click");</p><p> }</p><p> }</p><p> }</p><p> }</p><p> }</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="te3hpurp, post: 1065794, member: 82806"] Okay here it goes. It is plain Document completed event receiver. At the beginning there is chek if document really is complete. It is quite important to check, cos event appears many times before document is ready. When it is. We go on. First we select profile, and when we get new document complete event there is (if try again button appears) html element which class name contains "errorBtn". Actually it contains also "tryBtn in same class name but it is not a problem. So if we find try again button we just invoke it. [CODE] private void webBrowser1_DocumentCompleted(System.Object sender, WebBrowserDocumentCompletedEventArgs e) { if (this.webBrowser1.ReadyState != WebBrowserReadyState.Complete){ return;}else{ System.Diagnostics.Debug.Print("COMLETED !!"); if (e.Url.Equals(webBrowser1.Url)) { HtmlDocument document = webBrowser1.Document; //parse profiles foreach (HtmlElement ele in document.All) { // elementofpage.Add(ele); if (ele.InnerHtml != null) { if (ele.GetAttribute("className").ToString().Contains("ng-binding")) { profiles.Add(ele); } } } // Select profile if(profiles.Count>0){ //Here can check which profile to select profiles[0].InvokeMember("click"); } profiles.Clear(); // Bypass 'Something went wrong, try again ' try button foreach (HtmlElement ele in document.All) { if (ele.InnerHtml != null) { if (ele.GetAttribute("className").ToString().Contains("errorBtn")) { // profiles.Add(ele); ele.InvokeMember("click"); } } } } } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Netflix plugin (NetflixAlpha)
Contact us
RSS
Top
Bottom