MJ36 Posted March 28, 2019 Posted March 28, 2019 (edited) Hi, I would ask for help. Code below I do not know why @error does not work. My point is to load another one, it will load another one. Additional question: * Can i instead "@error" use "if $ _IESTATUS_NoMatch then" if so how? * Can i somehow set the script to restart the code after the error has finished #include <IE.au3> Local $oIE = _IECreate("https://www.google.pl/") _IELoadWait ($oIE) Sleep (2000) _IENavigate ($oIE, "http://moje-asgsdgd") Sleep (2000) Local $przycisk = _IEGetObjById ($oIE, "middle-top") _IEAction ($przycisk, "click") If @error Then _IENavigate ($oIE, "https://www.wp.pl/") EndIf Best regards Edited March 28, 2019 by MJ36 big fonts edit
Developers Jos Posted March 28, 2019 Developers Posted March 28, 2019 What is the reason you feel you need to shout at us with these big fonts? Please don't and use the standard forum font unless something needs to be emphasized. 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.
MJ36 Posted March 28, 2019 Author Posted March 28, 2019 @Jos I'm sorry it was not my goal I corrected
Nine Posted March 29, 2019 Posted March 29, 2019 On 3/28/2019 at 4:53 AM, MJ36 said: _IENavigate ($oIE, "http://moje-asgsdgd") is not accessible. And my crystal ball is at repair shop. Show DOM of the object... “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
MJ36 Posted March 29, 2019 Author Posted March 29, 2019 But why the DOM of the object this is just an example of such a site does not exist intentionally. What I mean is that if there is no such page, the script will detect the error and switch to another one
Nine Posted March 29, 2019 Posted March 29, 2019 Well I just tested it and @error is set correctly, based on your own code. “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Earthshine Posted March 29, 2019 Posted March 29, 2019 (edited) I just ran your code above. it works and goes to all the pages. here is the output from the editor console capture Quote >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\test.au3" /UserParams +>10:30:57 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:D:\test.au3 +>10:30:57 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "D:\test.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop --> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (middle-top) --> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType +>10:31:31 AutoIt3.exe ended.rc:0 +>10:31:31 AutoIt3Wrapper Finished. >Exit code: 0 Time: 34.81 test your script on another system. Edited March 29, 2019 by Earthshine My resources are limited. You must ask the right questions
MJ36 Posted May 8, 2019 Author Posted May 8, 2019 (edited) I'm sorry but I still have not solved the problem. of course, as you write, @error is displayed but he does not go to www.wp.pl and that's what I meant Edited May 8, 2019 by MJ36
Nine Posted May 8, 2019 Posted May 8, 2019 @MJ36 Ok, I now understand what is your problem. You see when you navigate to an invalid URL ("http://moje-asgsdgd"), IE won't allow you to navigate to another site. So you need to return back to the previous valid site by using Send ("!{LEFT}") Personally, I wouldn't use this approach. I would prefer testing the validity of the URL first. If valid then navigate and do your stuff. If not valid then move on to the next site. “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
MJ36 Posted May 9, 2019 Author Posted May 9, 2019 @Nine I would also prefer not to use "Send". And how to check such correctness? Thank you for help and direction
Nine Posted May 9, 2019 Posted May 9, 2019 21 minutes ago, MJ36 said: And how to check such correctness? There is multiple ways to do such. My personal preference goes to : InetGetSize ("url",$INET_FORCERELOAD) if @error then ; means url is invalid endif It is simple, fast, no need for additional udf. MJ36 1 “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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