Jump to content

3 buttons on webpage in frame with same tag name


 Share

Go to solution Solved by dar100111,

Recommended Posts

Hey All!

I think there might be a way to click on the right one by index for my $submit button.

Has anyone ever tried this or know how I might be able to pull this off?

It's clicking on the first one it comes too and I need the 3rd.

Script below and thank you in advance!

#include <IE.au3>
#include <Excel.au3>
#include <Array.au3>
$counter = 1
$oIEb = _IECreate("http://www.ssui.com/inquiry_v2.html", 0, 1)
$oFrame = _IEFrameGetObjByName($oIEb, "body")
$Letter = _IEGetObjByName($oFrame, "LETTER")
$minquiryfield = _IEGetObjByName($oFrame, "multiple_list")
$submitbutton = _IEGetObjByName($oFrame, "CFBQCOMMAND")
_IEFormElementSetValue($Letter, "s")
_IEFormElementSetValue($minquiryfield, "E052809926")
_IEAction($submitbutton, "click")
_IELoadWait($oIEb)
_IEAction($oIEb, "back")
Link to comment
Share on other sites

The key to solving this one is in the source of the webpage. You want to submit the correct value to identify the button.

<!--Button 1:--><INPUT type="submit" value="Submit/Single" name="CFBQCOMMAND">
<!--Button 2:--><INPUT type="submit" value="Submit/Multiple" name="CFBQCOMMAND">
<!--Button 3:--><INPUT type="submit" value="Submit/MultiList" name="CFBQCOMMAND">

Perhaps add another _IEFormElementSetValue() into your code? Something like this?

#include <IE.au3>
#include <Excel.au3>
#include <Array.au3>
$counter = 1
$oIEb = _IECreate("http://www.ssui.com/inquiry_v2.html", 0, 1)
$oFrame = _IEFrameGetObjByName($oIEb, "body")
$Letter = _IEGetObjByName($oFrame, "LETTER")
$minquiryfield = _IEGetObjByName($oFrame, "multiple_list")
$submitbutton = _IEGetObjByName($oFrame, "CFBQCOMMAND")
_IEFormElementSetValue($Letter, "s")
_IEFormElementSetValue($minquiryfield, "E052809926")
_IEFormElementSetValue($submitbutton, "Submit/MultiList")
_IEAction($submitbutton, "click")
_IELoadWait($oIEb)
_IEAction($oIEb, "back")
Edited by Wruck
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...