Results 1 to 2 of 2

[VB] Sample bot coding help needed

This is a discussion on [VB] Sample bot coding help needed within the Source Code Samples forums, part of the Programming category; i need to get the bot to enter the email in the email field on this sample site. i got ...

  1. #1
    abedel is offline Member
    Join Date
    Jun 2008
    Posts
    45

    Default [VB] Sample bot coding help needed

    i need to get the bot to enter the email in the email field on this sample site. i got everything else to work accept the email. i am not using the dot trick for this.

    this is the site: http://www.escada-fragrances.com/mar...e/sampling.php

    this is an example of how im coding it:

    WebBrowser1.Document.GetElementById("firstname").S etAttribute("value", txtfirst.Text)


    i tried to use email as the ID but its not working please post all possible solutions. thx.

  2.   Alt These ads help cover server costs and such.


  3. #2
    Join Date
    May 2008
    Location
    Korea
    Posts
    110

    Default

    Code:
    <label class="type-text required clearfix" id="email">
                                            <span>Email*:</span>
                                            <input type="input" value="" name="email" id="email"
    There are more than 1 elements with the id "email" so just do something like this:

    C#
    Code:
     foreach (HtmlElement htmlElem in webBrowser1.Document.All)
                {
                    if (htmlElem.Name == "email")
                    {
                        htmlElem.SetAttribute("value", "bob@gmail.com");
                        break;
                    }
                }
    VB.NET
    Code:
    For Each htmlElem As HtmlElement In webBrowser1.Document.All
        If htmlElem.Name = "email" Then
            htmlElem.SetAttribute("value", "bob@gmail.com")
            Exit For
        End If
    Next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Facebook Bots | Admin Forum