Web login bot problem

  • VB.NET

Es gibt 4 Antworten in diesem Thema. Der letzte Beitrag () ist von Gianfranco Ramoser.

    Web login bot problem

    liebe vb-paradise-community

    habe folgendes prob:

    VB.NET-Quellcode

    1. WebBrowser1.Document.GetElementById("login_user").SetAttribute("value", TextBox2.Text)
    2. WebBrowser1.Document.GetElementById("login_pass_logout").SetAttribute("value", TextBox3.Text)

    funzt leider nicht :(.
    also man soll sich via form einloggen können & mit einer numericupdown den server festlegen können.
    hier der code von der website auf der sich eingeloggt werden soll:

    VB.NET-Quellcode

    1. <div id="logoutloginform">
    2. <form method="POST" action="serverwahl_login.php" id="form_login_logout" onSubmit="return submitLoginLogout()">
    3. <input type="hidden" name="ref" value="">
    4. <div class="logouthead brownbold">Anmeldung</div>
    5. <div class="brown spacer">Server:</div>
    6. <div><select name="server" tabindex="1" class="link"><option value="server1" >Server 1</option><option value="server2" >Server 2</option><option value="server3" >Server 3</option><option value="server4" >Server 4</option><option value="server5" >Server 5</option><option value="server6" >Server 6</option><option value="server7" >Server 7</option><option value="server8" >Server 8</option><option value="server9" >Server 9</option><option value="server10" >Server 10</option><option value="server11" >Server 11</option><option value="server12" >Server 12</option><option value="server13" >Server 13</option><option value="server14" >Server 14</option><option value="server15" >Server 15</option><option value="server16" >Server 16</option><option value="server17" >Server 17</option><option value="server18" >Server 18</option><option value="server19" >Server 19</option><option value="server20" >Server 20</option><option value="server21" >Server 21</option><option value="server22" >Server 22</option><option value="server23" >Server 23</option><option value="server24" >Server 24</option><option value="server25" >Server 25</option><option value="server26" >Server 26</option><option value="server27" >Server 27</option><option value="server28" >Server 28</option><option value="server29" >Server 29</option><option value="server30" >Server 30</option><option value="server31" >Server 31</option><option value="server32" >Server 32</option><option value="server33" >Server 33</option><option value="server34" >Server 34</option><option value="server35" >Server 35</option><option value="server36" >Server 36</option><option value="server37" >Server 37</option><option value="server38" >Server 38</option><option value="server39" >Server 39</option><option value="server40" >Server 40</option><option value="server41" >Server 41</option><option value="server42" >Server 42</option><option value="server43" >Server 43</option><option value="server44" >Server 44</option><option value="server45" >Server 45</option></select></div>
    7. <div class="clear" style="display:inline;"></div>
    8. <!--login-->
    9. <div class="brown spacer" style="display:inline;">Login:</div>
    10. <div><input type="text" id="login_user" name="login" maxlength="100" size="20" tabindex="2" class="text"></div>
    11. <div class="clear" style="display:inline;"></div>
    12. <!--password-->
    13. <div class="brown spacer" style="display:inline;">Passwort:</div>
    14. <div>
    15. <input type="password" id="login_pass_logout" name="dummy" maxlength="100" size="20" tabindex="3" class="text">
    16. <input type="hidden" name="pass" value="" id="b64_pass_logout">
    17. </div>
    18. <div class="clear" style="display:inline;"></div>
    19. <div class="brown spacer" style="display:inline;">GFX aktiv?<input type="checkbox" name="gfx_aktiv" class="link" checked style="border:none;" onchange="resetClick();" tabindex="4"></div>
    20. <div class="clear" style="display:inline;"></div>
    21. <div><input class="submitbutton spacer link" type="submit" id="submitlogin_logout" name="submitlogin_logout" value="Einloggen" tabindex="5"></div>
    22. <div class="clear"></div>
    23. </form>

    mfg epolarity :thumbsup:
    Probier einfach mal statt den ID's die Names zu nehmen:

    VB.NET-Quellcode

    1. WebBrowser1.Document.GetElementById("login").SetAttribute("value", TextBox2.Text)
    2. WebBrowser1.Document.GetElementById("dummy").SetAttribute("value", TextBox3.Text)
    Hier ist mein Code:

    VB.NET-Quellcode

    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2. TabControl1.SelectedIndex += 1
    3. WebBrowser1.Document.GetElementById("login").SetAttribute("value", TextBox2.Text)
    4. WebBrowser1.Document.GetElementById("dummy").SetAttribute("value", TextBox3.Text)
    5. WebBrowser1.Document.GetElementById("submitlogin_logout")
    6. End Sub


    & hier der quelltext der website in der sich eingeloggt werden soll

    Quellcode

    1. <div id="logoutloginform">
    2. <form method="POST" action="serverwahl_login.php" id="form_login_logout" onSubmit="return submitLoginLogout()">
    3. <input type="hidden" name="ref" value="">
    4. <div class="logouthead brownbold">Anmeldung</div>
    5. <div class="brown spacer">Server:</div>
    6. <div><select name="server" tabindex="1" class="link"><option value="server1" >Server 1</option><option value="server2" >Server 2</option><option value="server3" >Server 3</option><option value="server4" >Server 4</option><option value="server5" >Server 5</option><option value="server6" >Server 6</option><option value="server7" >Server 7</option><option value="server8" >Server 8</option><option value="server9" >Server 9</option><option value="server10" >Server 10</option><option value="server11" >Server 11</option><option value="server12" >Server 12</option><option value="server13" >Server 13</option><option value="server14" >Server 14</option><option value="server15" >Server 15</option><option value="server16" >Server 16</option><option value="server17" >Server 17</option><option value="server18" >Server 18</option><option value="server19" >Server 19</option><option value="server20" >Server 20</option><option value="server21" >Server 21</option><option value="server22" >Server 22</option><option value="server23" >Server 23</option><option value="server24" >Server 24</option><option value="server25" >Server 25</option><option value="server26" >Server 26</option><option value="server27" >Server 27</option><option value="server28" >Server 28</option><option value="server29" >Server 29</option><option value="server30" >Server 30</option><option value="server31" >Server 31</option><option value="server32" >Server 32</option><option value="server33" >Server 33</option><option value="server34" >Server 34</option><option value="server35" >Server 35</option><option value="server36" >Server 36</option><option value="server37" >Server 37</option><option value="server38" >Server 38</option><option value="server39" >Server 39</option><option value="server40" >Server 40</option><option value="server41" >Server 41</option><option value="server42" >Server 42</option><option value="server43" >Server 43</option><option value="server44" >Server 44</option><option value="server45" >Server 45</option></select></div>
    7. <div class="clear" style="display:inline;"></div>
    8. <!--login-->
    9. <div class="brown spacer" style="display:inline;">Login:</div>
    10. <div><input type="text" id="login_user" name="login" maxlength="100" size="20" tabindex="2" class="text"></div>
    11. <div class="clear" style="display:inline;"></div>
    12. <!--password-->
    13. <div class="brown spacer" style="display:inline;">Passwort:</div>
    14. <div>
    15. <input type="password" id="login_pass_logout" name="dummy" maxlength="100" size="20" tabindex="3" class="text">
    16. <input type="hidden" name="pass" value="" id="b64_pass_logout">
    17. </div>
    18. <div class="clear" style="display:inline;"></div>
    19. <div class="brown spacer" style="display:inline;">GFX aktiv?<input type="checkbox" name="gfx_aktiv" class="link" checked style="border:none;" onchange="resetClick();" tabindex="4"></div>
    20. <div class="clear" style="display:inline;"></div>
    21. <div><input class="submitbutton spacer link" type="submit" id="submitlogin_logout" name="submitlogin_logout" value="Einloggen" tabindex="5"></div>
    22. <div class="clear"></div>
    23. </form>

    1. wiso funktioniert es nicht ?
    2. soll via numericupdown der server ausgewählt werden hat irgendjemand ne idee ?

    mfg epoloarity 2k11