naru Posted January 26, 2019 Author Posted January 26, 2019 13 minutes ago, Subz said: So is it putting in the correct amount into both fields? @Subz, its put correct amount
Subz Posted January 26, 2019 Posted January 26, 2019 Are you sure you don't need ".450" rather than "450"? As I don't have access to your page, I'd just be guessing why it's not working, you could try clicking on each item (maybe java event) $oStockKg = _IEGetObjById($oIE, $sStockKg) If IsObj($oStockKg) Then $oStockKg.Value = $iKg _IEAction($oStockKg, "Click") Endif $sStockGram = $oTds(4).FirstElementChild.getAttribute("id", 2) $oStockGram = _IEGetObjById($oIE, $sStockGram) If IsObj($oStockGram) Then $oStockGram.Value = $iGram _IEAction($oStockGram, "Click") EndIf
naru Posted January 26, 2019 Author Posted January 26, 2019 (edited) 1 hour ago, Subz said: Are you sure you don't need ".450" rather than "450"? As I don't have access to your page, I'd just be guessing why it's not working, you could try clicking on each item (maybe java event) $oStockKg = _IEGetObjById($oIE, $sStockKg) If IsObj($oStockKg) Then $oStockKg.Value = $iKg _IEAction($oStockKg, "Click") Endif $sStockGram = $oTds(4).FirstElementChild.getAttribute("id", 2) $oStockGram = _IEGetObjById($oIE, $sStockGram) If IsObj($oStockGram) Then $oStockGram.Value = $iGram _IEAction($oStockGram, "Click") EndIf @Subz i get error on line 33 expandcollapse popup#include <IE.au3> HotKeySet("{ESC}", "Quit") Func Quit() Exit EndFunc $oIE = _IEAttach ("Home") _IELoadWait($oIE) Local $oStockKg = _IEGetObjById($oIE, "txtbuyingstockinkg0") If IsObj($oStockKg) And StringStripWS($oStockKg.Value, 8) = "" Then Local $iOutStanding, $iKg, $iGram, $oStockKg, $oStockGram, $sStockKg, $sStockGram Local $oTds, $oTrs = _IETagNameGetCollection($oIE, "tr") If IsObj($oTrs) Then For $i = 1 To $oTrs.Length $oTr = $oTrs($i) $oTds = _IETagNameGetCollection($oTr, "td") If IsObj($oTds) And $oTds.Length = 5 Then $iOutStanding = $oTds(1).InnerText $iKg = StringLeft($iOutStanding, StringInStr($iOutStanding, ".")-1) $iGram = StringTrimLeft($iOutStanding, StringInStr($iOutStanding, ".")) $sStockKg = $oTds(3).FirstElementChild.getAttribute("id", 2) $oStockKg = _IEGetObjById($oIE, $sStockKg) If IsObj($oStockKg) Then $oStockKg.Value = $iKg _IEAction($oStockKg, "Click") EndIf $sStockGram = $oTds(4).FirstElementChild.getAttribute("id", 2) $oStockGram = _IEGetObjById($oIE, $sStockGram) If IsObj($oStockGram) Then $oStockGram.Value = $iGram _IEAction($oStockGram, "Click") EndIf Next $btnnext = _IEGetObjById($oIE,"btnnext") _IEAction($btnnext,"click") EndIf EndIf $btnnext = _IEGetObjById($oIE,"btnnext") _IEAction($btnnext,"click") _IELoadWait($oIE) Exit Edited January 26, 2019 by Nareshm
Subz Posted January 26, 2019 Posted January 26, 2019 Scite tells you exactly what the issue is so fix it, hint your missing Endif, please at least try to resolve issues yourself, as I mentioned I've written the code blind, I do not have anything to test against, you do, so you will need to fix and diagnose as required.
naru Posted February 25, 2019 Author Posted February 25, 2019 Hello @Subz I added : If IsObj($oStockKg) Then $oStockKg.Value = $iKg _IEAction($oStockKg, "Click") But Webpage showing same error "The amount of taking is greater than the remaining quantity." error and then reload page and input box is empty again. When i enter amount manualy no error showing. My Whole Code is : expandcollapse popup#include <IE.au3> Func Quit() Exit EndFunc $oIE = _IEAttach ("Home") _IELoadWait($oIE) Local $oStockKg = _IEGetObjById($oIE, "txtbuyingstockinkg0") If IsObj($oStockKg) And StringStripWS($oStockKg.Value, 8) = "" Then Local $iOutStanding, $iKg, $iGram, $oStockKg, $oStockGram, $sStockKg, $sStockGram Local $oTds, $oTrs = _IETagNameGetCollection($oIE, "tr") If IsObj($oTrs) Then For $i = 1 To $oTrs.Length $oTr = $oTrs($i) $oTds = _IETagNameGetCollection($oTr, "td") If IsObj($oTds) And $oTds.Length = 5 Then $iOutStanding = $oTds(1).InnerText $iKg = StringLeft($iOutStanding, StringInStr($iOutStanding, ".")-1) $iGram = StringTrimLeft($iOutStanding, StringInStr($iOutStanding, ".")) $sStockKg = $oTds(3).FirstElementChild.getAttribute("id", 2) $oStockKg = _IEGetObjById($oIE, $sStockKg) If IsObj($oStockKg) Then $oStockKg.Value = $iKg _IEAction($oStockKg, "Click") EndIf $sStockGram = $oTds(4).FirstElementChild.getAttribute("id", 2) $oStockGram = _IEGetObjById($oIE, $sStockGram) If IsObj($oStockGram) Then $oStockGram.Value = $iGram _IEAction($oStockGram, "Click") EndIf EndIf Next $btnnext = _IEGetObjById($oIE,"btnnext") _IEAction($btnnext,"click") EndIf EndIf
jmp Posted October 21, 2019 Posted October 21, 2019 @Subz I want to fill this type text box using this code, but i have another schemes named with rice and i want to fill it with 0 in both kg and gram in rice tab, its possible?
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