Jump to content

Autoit script help needed - (Moved)


Recommended Posts

hello, I'm newbie here. I'm stuck... base on the source code. How can I send the form? I sense that some thing need to do with the below Bolded syntax. So Expert please guide me how to send the Post method in Autoit script. After the double was my Autoit script.

 

 

<div id="contentContainer" class="layout_twoColumnLeft clearfix">
  <div id="overlayContent">
  <div id="news" class="pcs clearfix">
  <form name="LoginForm" id="LoginForm" method="post" action="/eParcel/common/auth/submitLogin.do" class="clear:both">
  <fieldset class="noborder">
  <div class="leftarea">
  <a href="http://auspost.com.au/business/eparcel.html" target="_blank">
  <img id="contextImage1" src="https://auspost.com.au/images/eParcel/option1.jpg" alt=""/>
  </a>
  </div>
  <div class="rightarea">
  <table rules="none" frame="void" border="0" cellpadding="1" cellspacing="1">
  <tr>
  <td class="bottomline" colspan="3"><h1 class="plainAnchor">Welcome to
  eParcel</h1></td>
  </tr>
  <tr>
  <td colspan="3">
  <div id="messages" style="color: red; "></div>
  </td>
  </tr>
  <tr>
  <td class="required">*</td>
  <td class="label" colspan="2">Required information</td>
  </tr>
  <tr>
  <td class="required">*</td>
  <td class="label">Username</td>
  <td><input type="text" name="userName" value="" id="userName" class="sizetwenty"></td>
  </tr>
  <tr>
  <td class="required">*</td>
  <td class="label">Password</td>
  <td><input type="password" name="password" value="" id="password" class="sizetwenty"></td>
  </tr>
  <tr>
  <td colspan="3">
  <div style="width: 100%;">
  <div style="width: 70%; float: left;">
  <h1><a id="resetPasswordLink">Forgotten your password?&nbsp;&nbsp;&nbsp;Click Here</a></h1>
  </div>
  <div style="width: 30%; float: right;">
  <button type="submit" class="button primary inputButton">Login <span class="caret">&raquo;</span></button>
  </div>
  </div>
  </td>
  </tr>

 

 

 

 

 

<tr>

======================================================================================================================================================

 

 

 

 

#include <IE.au3>
; Create a browser window and navigate to Australia Post
$oIE = _IECreate("https://online.auspost.com.au/eParcel/common/auth/login.do")
; get pointers to the login form and username, password and signin fields
Local $o_form = _IEFormGetObjByName($oIE, "LoginForm")
Local $o_login = _IEFormElementGetObjByName($o_form, "userName")
Local $o_password = _IEFormElementGetObjByName($o_form, "password")
Local $username = "abctesting"
Local $password = "abctesting"
; Set field values and submit the form
_IEFormElementSetValue($o_login, $username)
_IEFormElementSetValue($o_password, $password)
_IEAction($o_password, "focus")

 

 

 

 

 

Link to comment
Share on other sites

#include <IE.au3>
; Create a browser window and navigate to Australia Post
$oIE = _IECreate("https://online.auspost.com.au/eParcel/common/auth/login.do")
; get pointers to the login form and username, password and signin fields
Local $o_form = _IEFormGetObjByName($oIE, "LoginForm")
Local $o_login = _IEFormElementGetObjByName($o_form, "userName")
Local $o_password = _IEFormElementGetObjByName($o_form, "password")
Local $username = "abcd123
Local $password = "abcd123"
; Set field values and submit the form
_IEFormElementSetValue($o_login, $username)
_IEFormElementSetValue($o_password, $password)
;_IEAction($o_password, "focus")
_IEFormSubmit($o_form)

 

 

Just add _IEFormSubmit($o_form)

Link to comment
Share on other sites

  • Developers

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi @9tailsfox,

welcome to the forum.

For better readability use the code tags „<>“ to show your code. It shows syntax highlighting. It will make it easier to copy your code into an editor to test the code too.

Regards, Conrad

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...