naru Posted February 26, 2019 Share Posted February 26, 2019 i am using this code for filling text box of IE : 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 Exit But i want to check every input box and fill the only empty inputbox like sugar and oil, and skip wheat and Toor Dal. Becuase they have already text. Link to comment Share on other sites More sharing options...
Bert Posted February 26, 2019 Share Posted February 26, 2019 I'm not going to rewrite your script however I can give you direction If I'm reading this script right you are only looking for blank fields on your first IF statement (line 10). Instead, read all the fields and then search the collection for blank fields. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Nine Posted February 26, 2019 Share Posted February 26, 2019 I think this solution fits better your intentions : If IsObj($oStockKg) Then if $oStockKg.Value <> "" then ContinueLoop ; <======== add this line $oStockKg.Value = $iKg _IEAction($oStockKg, "Click") EndIf “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
naru Posted February 26, 2019 Author Share Posted February 26, 2019 (edited) @Nine error in line 29. My 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 If $oStockKg.Value <> "" then ContinueLoop ; <======== add this line $oStockKg.Value = $iKg _IEAction($oStockKg, "Click") EndIf EndIf $sStockGram = $oTds(4).FirstElementChild.getAttribute("id", 2) $oStockGram = _IEGetObjById($oIE, $sStockGram) If IsObj($oStockGram) Then $oStockGram.Value = $iGram _IEAction($oStockGram, "Click") EndIf Next EndIf EndIf Edited February 26, 2019 by Nareshm adding code Link to comment Share on other sites More sharing options...
Nine Posted February 26, 2019 Share Posted February 26, 2019 @Nareshm idk, this is your code. The line I suggested you add is not causing this error... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
naru Posted February 27, 2019 Author Share Posted February 27, 2019 (edited) @Nine Thank you, working perfect, its my mistake because i added two time endif in line 27. but i need little more help, i want to check all outstanding amount if outstanding amount value of all scheme are 0.000 then i want click on new bill then exit script. I tried with this code : Local $oTds = _IETagNameGetCollection($oIE, "td") For $oTd In $oTds If $oTd.InnerText = "0.000" Then _IEAction(_IEGetObjById($oIE,"lnkbill"),"click") Exit endIf Next But it was checking only one scheme. *sorry for my bad english.* Edited February 27, 2019 by Nareshm for adding _IEAction line in script Link to comment Share on other sites More sharing options...
Nine Posted February 27, 2019 Share Posted February 27, 2019 Local $bFound = False, $oTds = _IETagNameGetCollection($oIE, "td") For $oTd In $oTds $bFound = Number($oTd.InnerText) <> 0 Next If not $bFound then _IEAction(_IEGetObjById($oIE,"lnkbill"),"click") Exit endif Try this (untested ofc) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
naru Posted February 27, 2019 Author Share Posted February 27, 2019 @Nine It does not help me Link to comment Share on other sites More sharing options...
naru Posted February 28, 2019 Author Share Posted February 28, 2019 Anyone have any ideas ? Please Link to comment Share on other sites More sharing options...
Bert Posted February 28, 2019 Share Posted February 28, 2019 I gave you the solution. Look above. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
naru Posted March 16, 2019 Author Share Posted March 16, 2019 On 2/28/2019 at 8:45 PM, Bert said: I gave you the solution. Look above. @Bert Where is ? Link to comment Share on other sites More sharing options...
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