lordofthestrings Posted August 3, 2018 Posted August 3, 2018 Hi guys, long time since my last post. I'm a long time user of AutoIt, but I've been on a break a few years.. started using Autoit again for my daily administration tasks and I'm having trouble completing my script. some context: I need to surf to a website and wait for it to load completely. then I read the entire page and check if in this HTML output I find the string "Store: OPEN" I read the entire HTML code no problem.. when I manually check the output I can clearly see "Store: OPEN" but my STRINGINSTR AutoIt command doesn't want to see it for some reason.. Can someone point me in the right direction as to what I'm doing wrong? example html code is also included. thanks in advance #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <IE.au3> If $cmdline[0] = 0 Then ConsoleWrite("argument: IP Adress" & @CRLF) $oIE = _IECreate("http://10.2.21.71:8080", 0, 0, 1) Else $oIE = _IECreate("http://" & $cmdline[1] & ":8080", 0, 0, 1) EndIf Sleep(8000) $sHTML = _IEBodyReadHTML($oIE) _IEQuit($oIE) Local $iPosition = StringInStr($sHTML, "Store: OPEN") If $iPosition <> 0 Then ConsoleWrite($iPosition & @CRLF) Else ConsoleWrite($sHTML & @CRLF) EndIf <table class="messageAndClock"> <!-- Messages area + clock --> <tbody> <tr> <td class="messagesArea"> <div class="messagesAreaNoMessage" id="messagesArea"> xxxvNP6.1.23.MR30QR6B9929 Pkg:3523016 Store:OPEN </div> </td> <td class="clockArea"> <div class="clockArea" id="clockArea">20180803 08:44 Business Day: 20180803</div> </td> </tr> </tbody> </table> <table class="listAndButtons" id="listAndButtons" style="height: 236.64px;"> <tbody>
Developers Jos Posted August 3, 2018 Developers Posted August 3, 2018 11 minutes ago, lordofthestrings said: Store:OPEN Don't think there is a space there while there is one here: 11 minutes ago, lordofthestrings said: StringInStr($sHTML, "Store: OPEN") Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
lordofthestrings Posted August 3, 2018 Author Posted August 3, 2018 (edited) I'm sure this will do the trick for me Thanks Jos! Jos: You solved my issue! Edited August 3, 2018 by lordofthestrings
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