Jump to content

Recommended Posts

Posted

I am adding labour charge to total paid amount using

#include <IE.au3>
#include <Array.au3>
$oIE = _IEAttach ("Shop")
$oTable = _IETableGetCollection ($oIE, 1)
$aTableData3 = _IETableWriteToArray ($oTable)
Local $sitem1 = $aTableData3[5][1]
Local $sitem2 = $aTableData3[5][2]
Local $lcharge = "10" ;add manualy using inputbox, becuase not generating online 

Local $atotPric = "Payable Total Price "
Local $oTds = _IETagNameGetCollection($oIE, "td")
For $oTd In $oTds
If $oTd.Innertext = $atotPric Then
        $iatotPric = $oTd.NextElementSibling.innertext
        MsgBox (0, "2", $iatotPric)
EndIf
Next

$irCtotal = StringFormat("%.2f", $sitem1 + $sitem2 + $lcharge)
 $crTotp = StringReplace(_IEBodyReadHTML($oIE), $iatotPric, $irCtotal)
_IEBodyWriteHTML ($oIE, $crTotp)

But, It was also changing Total price, I want to change only Payable Total Price.

1799274051_totalprice.JPG.2b42b5aa575bc08fff591afccb96d630.JPG

Posted
30 minutes ago, mikell said:
StringRegExpReplace(_IEBodyReadHTML($oIE), '(?s)Payable.*?\K' & $iatotPric, $irCtotal)

Untested (you should post text instead of an image so we can test)

@mikell if i want to change total price instead of payable total price then?

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...