gte Posted December 1, 2009 Share Posted December 1, 2009 In testing, I've had this work twice to where it returns an empty html file and once where it returned the correct html file? Here is my code, can these functions not work or read html when a machine is locked? $ietext =_IECreate("http://server/folder/folder/Rotation/Current.aspx?View=%7BE25B5C98%2D352E%2D4818%2D8FF7%2D448F0B581C3C%7D&ShowInGrid=HTML" , 0, 1, 0, 0) Do ConsoleWrite("Opening web page" & @CRLF) Until WinExists("Shift Rotation", "Shift Rotation") $ietext2 = _IEBodyReadHTML($ietext) $ietext3 = StringReplace($ietext2, '</TD><TD Class="ms-vb2">', '</TD> <TD Class="ms-vb2">') $saveschedulelocation = "\\serverlocation\schedule\schedule_" & $todaysdate & ".htm" FileWrite($saveschedulelocation, $ietext3) HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script Link to comment Share on other sites More sharing options...
jvanegmond Posted December 1, 2009 Share Posted December 1, 2009 I'm quite sure this part fails: Do ConsoleWrite("Opening web page" & @CRLF) Until WinExists("Shift Rotation", "Shift Rotation") You can replace it with _IELoadWait. github.com/jvanegmond Link to comment Share on other sites More sharing options...
gte Posted December 1, 2009 Author Share Posted December 1, 2009 Ok, I will do that It also appears that my string replace functions are taking longer than a few milliseconds, I have more then what's in the example. Is there a wait command for that? Or would a do ... until work for that? HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script Link to comment Share on other sites More sharing options...
jvanegmond Posted December 1, 2009 Share Posted December 1, 2009 Your script will not continue until a function call completely returns. This means that for the rest of your script, it is irrelevant how long StringReplace takes. github.com/jvanegmond Link to comment Share on other sites More sharing options...
gte Posted December 1, 2009 Author Share Posted December 1, 2009 That is what I had thought too, the reason I questioned/suggested it is because when it is saving the .htm file, it's cutting it off at about 40 lines of html, unless I put a sleep command in before the filewrite or consolewrite??Your script will not continue until a function call completely returns. This means that for the rest of your script, it is irrelevant how long StringReplace takes. HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script Link to comment Share on other sites More sharing options...
jvanegmond Posted December 1, 2009 Share Posted December 1, 2009 That's definitely not the case. It can also be the FileWrite command being cut off due to network issues. - You can write the file locally first, then try to copy it to it's new location. Or it can be because you used _IEBodyReadHTML instead of _IEDocReadHTML github.com/jvanegmond Link to comment Share on other sites More sharing options...
gte Posted December 1, 2009 Author Share Posted December 1, 2009 Are you saying to use IEDocReadHTML, cause I'm using body already.Also, with the file write, I used a console write to compare, to eliminate network issues, and it did the same thing without that extra pause?Maybe my do ... until for the webpage was failing/not loading in time? And the iewait will fix that?That's definitely not the case.It can also be the FileWrite command being cut off due to network issues. - You can write the file locally first, then try to copy it to it's new location.Or it can be because you used _IEBodyReadHTML instead of _IEDocReadHTML HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script Link to comment Share on other sites More sharing options...
jvanegmond Posted December 1, 2009 Share Posted December 1, 2009 At this stage, it's very important that you start making changes to your code and see if it works. github.com/jvanegmond Link to comment Share on other sites More sharing options...
gte Posted December 2, 2009 Author Share Posted December 2, 2009 I implemented your changes, and also put some wait commands in, and it did not happen last night, I'll see how it performs the rest of the week, and if it is consistent, I'll be good to go HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script 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