jmp Posted August 20, 2019 Posted August 20, 2019 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.
mikell Posted August 20, 2019 Posted August 20, 2019 StringRegExpReplace(_IEBodyReadHTML($oIE), '(?s)Payable.*?\K' & $iatotPric, $irCtotal) Untested (you should post text instead of an image so we can test)
jmp Posted August 20, 2019 Author Posted August 20, 2019 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?
mikell Posted August 20, 2019 Posted August 20, 2019 (edited) StringRegExpReplace(_IEBodyReadHTML($oIE), '(?s)>Total Price.*?\K' & $iatotPric, $irCtotal) Edited August 20, 2019 by mikell stupid mistake :(
jmp Posted August 20, 2019 Author Posted August 20, 2019 6 hours ago, mikell said: StringRegExpReplace(_IEBodyReadHTML($oIE), '(?s)>Total Price.*?\K' & $iatotPric, $irCtotal) @mikell Why text not replacing if price format is 000.00 (Like 130.00, 115.50) ?
mikell Posted August 20, 2019 Posted August 20, 2019 11 hours ago, mikell said: Untested (you should post text instead of an image so we can test) Wasn't it explicit enough ?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now