Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 20:24

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Webbrowser span click

Discussion on Webbrowser span click within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2011
Posts: 2
Received Thanks: 0
Unhappy Webbrowser span click

Hallo erstmal,

nach stundenlangen googlen habe ich nichts gefunden was mir weiterhelfen könnte.
Ich möchte nähmlich einfach ein Programm schreiben das ein click im webBrowser auf ein bild ausführt.
Was erstmal einfach klingt aber nicht einfach ist xD.
Ich habe es schon mit
Code:
webBrowser1.Document.GetElementById("vote_link_1").InvokeMember("click");
versucht aber das geht leider nicht.
Hier ist mal der quellcode der Seite
HTML Code:
<span id="vote_link_1" class="votelink">
<a onclick="ajax_loadContent('vote_link_1','./engine/dynamic/vote_proccess.php?id=vote_link_1','<img src=./engine/_style_res/1/images/voteimg/1.gif alt=[Vote]>');" target="_blank" href="http://www.***********************/in.php?site=33430">
<img alt="[Vote]" src="./engine/_style_res/1/images/voteimg/1.gif">
Ich hoffe ihr könnt mir helfen.
Kaelthas0 is offline  
Old 12/04/2011, 23:05   #2
 
elite*gold: 3
Join Date: Dec 2009
Posts: 969
Received Thanks: 314
PHP Code:
        For Each ele As HtmlElement In WebBrowser1.Document.GetElementsByTagName("a")
            If 
ele.GetAttribute("href").Contains("in.php"Then
                ele
.InvokeMember("click")
            
End If
        
Next 
.exTremez™ is offline  
Thanks
1 User
Old 12/05/2011, 13:38   #3
 
elite*gold: 0
Join Date: Apr 2011
Posts: 2
Received Thanks: 0
so ich habe es jetzt dank .exTremez™ hilfe gelöst und zwar habe ich jetzt
foreach (HtmlElement ele in
Code:
webBrowser1.Document.GetElementsByTagName("a"))
            {
                if (ele.GetAttribute("target").Contains("_blank"))
                {
                    System.Threading.Thread.Sleep(1000);
                    ele.InvokeMember("click");
                }
            }
genommen. Nun wird zwar noch etwas anderes angeklickt aber das ist egal.

Nochmal vielen dank .exTremez™!
Kaelthas0 is offline  
Reply

Tags
bot, button, click, span, webbrowser




All times are GMT +2. The time now is 20:24.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.