Programmtically Fill in a form?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anil Gupte/iCinema.com

    Programmtically Fill in a form?

    How can programmaticall y I fill in a form on a web page in VB? This is in a
    desktop program and I am using Webclient right now to get info on a page.
    In some cases it asks me to login and I want it to be automatic.

    Any suggestions welcome.

    Thanx,
    --
    Anil Gupte

    iCinema.com is a 7-character domain name that evokes a sense of entertainment, imagination, and fun. It combines the concepts of “i” (for information and interaction) with “cinema” to create an idea of an interactive cinema experien




  • Martin Honnen

    #2
    Re: Programmtically Fill in a form?

    Anil Gupte/iCinema.com wrote:
    How can programmaticall y I fill in a form on a web page in VB? This is in a
    desktop program and I am using Webclient right now to get info on a page.
    In some cases it asks me to login and I want it to be automatic.
    If you fill in a form on a "web page" and submit that then a HTTP
    request is made that sends the form data. You can do that with WebClient
    or with WebRequest, check the HTML document of the page to find out the
    control names in the form, the action URI attribute to submit to and the
    request method (e.g. GET or POST), then program the corresponding
    request with WebClient or WebRequest.

    WebClient has methods like this
    http://msdn.microsoft.com/en-us/library/900ted1f.aspx to make a GET or
    POST request with a collection of data.


    --

    Martin Honnen --- MVP XML

    Comment

    • Anil Gupte/iCinema.com

      #3
      Re: Programmtically Fill in a form?

      Thanx Martin:
      I got a little further as you suggested. I was already using WebClient, so
      was able to follow a link using

      Dim WCInstance As WebClient = New WebClient
      returnValue = WCInstance.Down loadData(ItemUR L)

      then parse that page and follow the signon link. Now when I get to the
      login form I have:

      <form name="loginForm " id="loginForm" method="post">
      <input type="hidden" name="current_f orm" value="loginFor m" />

      so there is nothing poiting to a URL to submit to and the submit button uses
      JavaScript to submit:

      <div class="action-button" style="" id="button-signin">
      <a id="button-signin-link" href='#'
      onclick='docume nt.getElementBy Id("loginForm") .submit(); return false;'>
      <div class="end-cap img-action-button-cap-left"></div>
      <div class="content hand"><span class="title" id="button-signin-title"
      >Sign In</span></div>
      <div class="end-cap img-action-button-cap-right"></div>
      </a>
      </div>
      <input type="hidden" name="action_lo gin" value="Log In">

      I am not sure how to proceed. Please advise.

      --
      Anil Gupte

      iCinema.com is a 7-character domain name that evokes a sense of entertainment, imagination, and fun. It combines the concepts of “i” (for information and interaction) with “cinema” to create an idea of an interactive cinema experien


      "Martin Honnen" <mahotrash@yaho o.dewrote in message
      news:O%23I4BWwJ JHA.4600@TK2MSF TNGP06.phx.gbl. ..
      Anil Gupte/iCinema.com wrote:
      >How can programmaticall y I fill in a form on a web page in VB? This is
      >in a desktop program and I am using Webclient right now to get info on a
      >page. In some cases it asks me to login and I want it to be automatic.
      >
      If you fill in a form on a "web page" and submit that then a HTTP request
      is made that sends the form data. You can do that with WebClient or with
      WebRequest, check the HTML document of the page to find out the control
      names in the form, the action URI attribute to submit to and the request
      method (e.g. GET or POST), then program the corresponding request with
      WebClient or WebRequest.
      >
      WebClient has methods like this
      http://msdn.microsoft.com/en-us/library/900ted1f.aspx to make a GET or
      POST request with a collection of data.
      >
      >
      --
      >
      Martin Honnen --- MVP XML
      http://JavaScript.FAQTs.com/

      Comment

      Working...