Jump to content

Recommended Posts

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

Share this post


Link to post
Share on other sites
11 hours ago, mikell said:

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

Wasn't it explicit enough ?

Share this post


Link to post
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

  • Similar Content

    • By cdeb
      As for the object, in this case the StringReplace() function does not work for me.
      These are my steps:
      1) Extract the subject from an EML file.
       (the first character is an emoji )
      source from EML file: 
      $sSubject = "?utf-8?B?8J+TiCA1IG9mIHRoZSBCZXN0IFN0b2NrcyB0byBCdXkgZm9yIERlY2VtYmVy?=" 2) in this case I perform a decoding with _QuotedPrintable_DecodeEncodedWord()
      output is: 
      $sSubject = "?? 5 of the Best Stocks to Buy for December"  
      3) I perform StringReplace():
      $sSubject = StringReplace($sSubject, "??", "") or
      $sSubject = StringReplace($sSubject, Chr(63)&Chr(63), "")  
      But the characters ?? they are not replaced.
       
      Yet if I make an Asc of every character of the string with a for loop, are the first two characters really? that is 63
      For cycle
              Local $aArray = StringSplit($sSubject, "", $STR_NOCOUNT)         For $i = 0 To UBound($aArray)-1             ConsoleWrite($aArray[$i] & " - " & Asc($aArray[$i])& @CR)         Next Output:        
      ? - 63
      ? - 63
        - 32
      5 - 53
        - 32
      o - 111
      f - 102
        - 32
      t - 116
      h - 104
      e - 101
        - 32
      Does anyone have an explanation of why it doesn't work?
      Thank you all
       
    • By jmp
      i am trying to get number from string using this code :
      #include <IE.au3> $oIE = _IEAttach ("Edu.corner") Local $aName = "Student name & Code:", $iaName = "0" Local $oTds = _IETagNameGetCollection($oIE, "td") For $oTd In $oTds If $oTd.InnerText = $aName Then $iaName = $oTd.NextElementSibling.InnerText $iGet = StringRegExpReplace($iaName, "\D", "") EndIf Next MsgBox(0, "", $iGet) it was get number like 52503058
      But, I want to get only student code 5250. (Different student have different code, sometime its 3 digits, Sometime 4)

       
    • By nacerbaaziz
      hello sirs
      i've some questions about StringRegExpReplace i hope you can help me
       
      i tried to make a function that give me the host of the url and other give me the url with out host
      for example i've this link
      https://www.example.com/vb/result.php
      i need the first give me the
      example.com
      and the other give me 
      /vb/result.php
      i find that
      $s_source = "https://www.google.com/vb/index.php" Local $s_Host = StringRegExpReplace($s_Source, '.*://(.*?)/.*', '\1') Local $s_Page = StringRegExpReplace($s_source, '.*://.*?(/.*)', '\1') msgBox(64, $s_Host, $s_Page)  
      but i found some problems i need your help to correct it
      first: when i get the host if the url has www i want to remove it
      second: if the url with out host did not have other things 
      i need the result to be ""
      e.g
      https://www.example.com
      the first i want it
      example.com
      and the second i want it to be ""
      i hope that you can help me
      thanks in advance
    • By fs1234
      Hi,
      I would like to change the hungarian characters in a string, but I can't figure out how to do it.
      Help, pls.
       
      #include <MsgBoxConstants.au3> Local $sInput = "Árvíztűrő tükörfúrógép" Local $sOutput = StringRegExpReplace($sInput, "(?-i)(á)|(Á)|(é)|(É)|(í)|(Í)|(ó)|(Ó)|(ö)|(Ö)|(ő)|(Ő)|(ú)|(Ú)|(ü)|(Ü)|(ű)|(Ű)", "(?1a)(?2A)(?3e)(?4E)(?5i)(?6I)(?7o)(?8O)(?9o)(?10O)(?11o)(?12O)(?13u)(?14U)(?15u)(?16U)(?17u)(?18U)") Display($sInput, $sOutput) Func Display($sInput, $sOutput) ; Format the output. Local $sMsg = StringFormat("Input:\t%s\n\nOutput:\t%s", $sInput, $sOutput) MsgBox($MB_SYSTEMMODAL, "Results", $sMsg) EndFunc ;==>Display  
    • By dascondor
      So basically need to pull text from a .txt file or .sql and use that text to replace something within a different file.
       
      First File:
      jumps
       
      Or:
      Text1 = jumps
      Text2 = fence
      Second File:
      My Dog XXXXX over the YYYYY.
       
       
      After Script:
      My Dog jumps over the fence
       
      I have found a good start, I'm basic programmer at best, I have some experience but this gets out of my wheel house.
       
      Any help is appreciated.
       
       
×
×
  • Create New...