Jump to content

Recommended Posts

Posted

Hopefully someone can help me focus on the first_number, and second_number form objects and input the correct data.

I am getting the following error:

If IsObj($o_object.elements.item ($s_name, $i_index)) Then

If IsObj($o_object^ ERROR

Error: Variable must be of type "Object"

When using the following code:

$o_SearchForm = _IEFormGetObjByName ($oIE, "jsp_name")
$o_Keywords = _IEFormElementGetObjByName ($o_SearchForm, "first_number")
_IEFormElementSetValue ($o_Keywords, "Testing")

Source Code

<table width="460" align="left" cellpadding="0" cellspacing="0" border="0">
  <FORM METHOD="POST" ACTION="/servlet/InvoiceServlet" METHOD="POST">
    <INPUT TYPE="hidden" NAME="jsp_name" VALUE="Invoiced">
    <INPUT TYPE="HIDDEN" NAME="orig_country"
      VALUE='US' >
    <INPUT TYPE="HIDDEN" NAME="language"
      VALUE='english' >
    <INPUT TYPE="hidden" NAME="service_type" 
      VALUE='E' >
    <INPUT TYPE="hidden" NAME="pay_type" 
      VALUE='invoice' >
    <INPUT TYPE="hidden" NAME="request_type" 
      VALUE='NewReq' >

    <tr> 
      <td CLASS="pagesubheader2" align=left valign="top"> 
        <table BORDER=0 ALIGN=left CELLPADDING=0 CELLSPACING=0 WIDTH=461>
          <tr> 
            <td align=right height="23" valign="top" width="36%">
              <b>Service Type:</b> 
            </td>
            <td align=right height="23" valign="top" width="2%">&nbsp;</td>
            <td align=left height="23" valign="top" width="62%">
              <img src="/images/shared/picture.gif" alt="Picture">

            </td>
          </tr>
          <tr> 
            <td width="36%" height="31" valign="top" align="right">
              <b>First Number:</b>
            </td>
            <td width="2%" height="31" valign="middle" align="right">&nbsp;</td>
            <td width="62%" height="31" valign="top" align="left">
              <input type="TEXT" name="first_number" size="15" maxlength="20"
                VALUE='' >
              <BR>
              
              
              
            </td>
          </tr>
          <tr> 
            <td width="36%" align="right" valign="top">
              <b>&nbsp;Second Number:</b>
            </td>
            <td width="2%" align="right">&nbsp;</td>
            <td width="62%" align="left"> 
              <input type=TEXT name="second_number" size="15" maxlength="9"
                VALUE='' >
              (9 digits)
              <BR>
              
              
              
            </td>
          </tr>
          <tr align="center"> 
            <td width="36%">&nbsp;</td>
            <td>&nbsp;</td>
            <td align="left" width="62%"><br>
              <input type="SUBMIT" value="Send Request"><BR><BR>
            </td>
          </tr>
        </table>
      </td>
    </tr>
are you using Beta version?
Posted

I certainly did not mean for my statements to come across the way that they did. I was not asking for you to write a script for me. I was just trying to carry on the conversation. I apprecite the help that you have given everyone that visits this forum.

Thanks again.

OK, thanks NSearch. Part of my ire was misdirected at you.

As I think about it, IE.au3 does not have a problem with https (and should not cause the error you reported), but INetGet will. INetGet will make a unique connection to the page and will not be able to negotiate the ssl protocol.

There is another option using a unique IE extension. It does a "saveas" and allows you to save to the local machine. It is documented to be able to work silently, but it does not in recent versions of IE -- I suspect this is done on purpose for security reasons. It insists on putting up a SaveAs dialog. If it helps I've included an example.

I don't see any other way to do this in IE or INetGet because of security limitations.

There are two other interfaces that are possibilities - WinHttpRequest and WinINet - but you'd be on your own there as I have not taken time to dig into them.

Here is the execCommand example that grabs the google logo:

#include <IE.au3>
$oIE = _IECreate()
_IENavigate($oIE, "http://www.google.com/intl/en/images/logo.gif")

$oIE.document.execCommand("saveas", 1)

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted (edited)

Hopefully someone can help me focus on the first_number, and second_number form objects and input the correct data.

I am getting the following error:

If IsObj($o_object.elements.item ($s_name, $i_index)) Then

If IsObj($o_object^ ERROR

Error: Variable must be of type "Object"

When using the following code:

$o_SearchForm = _IEFormGetObjByName ($oIE, "jsp_name")
$o_Keywords = _IEFormElementGetObjByName ($o_SearchForm, "first_number")
_IEFormElementSetValue ($o_Keywords, "Testing")
Another common cause os this is that there is a FRAME involved (use the View menu in the broswer and select Source instead of right-click, View Source). If so, you need to get a reference to the frame object instead of $oIE. Check @error after calling _IEFormGetObjByName or check isObj($o_SearchForm) to see if the form object was properly created.

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Posted

I am trying to grab pictures off of a website and store them in a folder for further processing. I have to navigate to the page, and enter numbers to get to the point which I grab the picture. I would like to do this all without the user having to bother with it (meaning that the mouse, and browser is tied up). I am currently searching the ie.au3 forum for ways to focus on the form input.....examples would be appreciated. Thanks.

Does that mean that the URL of the picture is different each time? It appears you have brushed off the use of

InetGet ( "URL", "filename" [, reload [, background]] )

I'm surprised, in that its purpose is to do exactly what you say you want. It even grabs CGI output from a Linux Firewall.

Have you already tried it and failed? If so please tell me how it failed.

If you don't know the URL, you may be able to get it in one of two ways:

1) If the picture is not configured as a link, navigate to it, right-click it, then click Properties on the popup menu. The URL can be drag selected with the mouse, copied and then pasted as needed.

2) If the picture is configured as a link, right-click the white space of the page, click ViewSource on the popup menu. Search through the text for the characters "SRC", that will take you to the links to each resource in the page. Careful reading of the surrounding text should help you determine the correct link for the picture of interest.

Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Posted (edited)

Here is the entire html code for that form section. There is a </form> tag, and there is not a frame on the page. If the form has no id, could that cause a problem? If so, is there a way around it?

<FORM METHOD="POST" ACTION="/servlet/Servlet" METHOD="POST">
    <INPUT TYPE="hidden" NAME="jsp_name" VALUE="Invoiced">
    <INPUT TYPE="HIDDEN" NAME="orig_country"
      VALUE='US' >
    <INPUT TYPE="HIDDEN" NAME="language"
      VALUE='english' >
    <INPUT TYPE="hidden" NAME="service_type" 
      VALUE='E' >
    <INPUT TYPE="hidden" NAME="pay_type" 
      VALUE='invoice' >
    <INPUT TYPE="hidden" NAME="request_type" 
      VALUE='NewReq' >

    <tr> 
      <td CLASS="pagesubheader2" align=left valign="top"> 
        <table BORDER=0 ALIGN=left CELLPADDING=0 CELLSPACING=0 WIDTH=461>
          <tr> 
            <td align=right height="23" valign="top" width="36%">
              <b>Service Type:</b> 
            </td>
            <td align=right height="23" valign="top" width="2%">&nbsp;</td>
            <td align=left height="23" valign="top" width="62%">
              <img src="/images/shared/picture.gif" alt="Blah">

            </td>
          </tr>
          <tr> 
            <td width="36%" height="31" valign="top" align="right">
              <b>First Number:</b>
            </td>
            <td width="2%" height="31" valign="middle" align="right">&nbsp;</td>
            <td width="62%" height="31" valign="top" align="left">
              <input type="TEXT" name="first_nbr" size="15" maxlength="20"
                VALUE='' >
              <BR>
              
              
              
            </td>
          </tr>
          <tr> 
            <td width="36%" align="right" valign="top">
              <b>&nbsp;Second Number:</b>
            </td>
            <td width="2%" align="right">&nbsp;</td>
            <td width="62%" align="left"> 
              <input type=TEXT name="second_nbr" size="15" maxlength="9"
                VALUE='' >
              (9 digits)
              <BR>
              
              
              
            </td>
          </tr>
          <tr align="center"> 
            <td width="36%">&nbsp;</td>
            <td>&nbsp;</td>
            <td align="left" width="62%"><br>
              <input type="SUBMIT" value="Send Request"><BR><BR>
            </td>
          </tr>
        </table>
      </td>
    </tr>
      <!-- row for note content -->
    <tr> 
      <td align="left"> 
        <img src="/images/shared/shared_dot_gray.gif" height="1" width="450" vspace="5"><br>
        <b class="subheader">Please note</b> <br>
        <ul>
            <li>See the terms and conditions in the current <A HREF='http://www.blah.com'>blah blah blah</A> for complete blah blah blah<br><br></li><li>blah blah blah<br><br></li>
            <li>blah blah blah</li>
        </ul>
      </td>
    </tr>
  </FORM>
Edited by NSearch
Posted

Here is the entire html code for that form section. There is a </form> tag, and there is not a frame on the page. If the form has no id, could that cause a problem? If so, is there a way around it?

if there's not a name given, you can use indexes to designate what form element you wish to access.

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
×
×
  • Create New...