Jump to content

Recommended Posts

Posted

Hello, I'm new to this coding but have almost finished my first script to create sites for me, but some sites have a price so I'm trying to stop the script from running if the id >$0.00. I'm using the Google calculator for a reference, if I start the Google calculator and have the $oLink = _IEGetObjById($oIE, "cwos") it will get the ID to the calculator's starting number of 0 but if i have it set to 8 is there a way to stop it if its not 0?

I know its "If $oLink = _IEGetObjById($oIE,"cwos>0") Then"

but i don't know what i can replace it with.

  here is part of the code.

#include <MsgBoxConstants.au3>
#include <GUIConstants.au3>
#include <IE.au3>

$oIE = _IECreate()
_IENavigate($oIE, "https://www.google.com/#q=calculator&spell=1")
_IELoadWait($oIE)
sleep(1000)

$oLink = _IEGetObjById($oIE, "cwos")
; $href = $oLink.href
_IEAction($oLink, "click")

If $oLink = _IEGetObjById($oIE,"cwos>0") Then
MsgBox(16,"Error","Subtotal is not $0.00, halting!")
Exit
EndIf
  • Solution
Posted

I *think* you are trying to do something like this..

$oLink = _IEGetObjById($oIE, "cwos")
if $oLink.innertext > 0 then MsgBox(16,"Error","Subtotal is not $0.00, halting!")

;o) Cor

nothing is foolproof to the sufficiently talented fool..

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
  • Recently Browsing   0 members

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