gahhon Posted January 25, 2019 Posted January 25, 2019 How can I detect is the IE opened? If opened, then open a new tab else, open new IE window and redirect to specific URL based on button click. Global $oBrowser = _IECreate() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON Call ("CloseApplication") Exit Case $Button1 Call ("Google") Case $Button2 Call ("Yahoo") Case $Button3 Call ("Hotmail") Case $Button4 Call ("Gmail") EndSwitch WEnd
FrancescoDiMuro Posted January 25, 2019 Posted January 25, 2019 @gahhon You should see if the process exists, if it does, then use _IEAttach; if it doesn't, then use _IECreate Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
gahhon Posted January 25, 2019 Author Posted January 25, 2019 1 minute ago, FrancescoDiMuro said: @gahhon You should see if the process exists, if it does, then use _IEAttach; if it doesn't, then use _IECreate Yes. I know that, but the problem is where do I declare the _IECreate? and _IEAttach need the IEObj anyway right? @@
FrancescoDiMuro Posted January 25, 2019 Posted January 25, 2019 @gahhon If ProcessExists("IE") Then _IEAttach(...) Else $objIE = _IECreate() EndIf Read carefully the documention about the two functions suggested in the previous post Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
gahhon Posted January 25, 2019 Author Posted January 25, 2019 3 minutes ago, FrancescoDiMuro said: @gahhon If ProcessExists("IE") Then _IEAttach(...) Else $objIE = _IECreate() EndIf Read carefully the documention about the two functions suggested in the previous post Should I declare the IE object as Global?
FrancescoDiMuro Posted January 25, 2019 Posted January 25, 2019 @gahhon If you want to have your object "visibile" throught your entire script... Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Moderators JLogan3o13 Posted January 25, 2019 Moderators Posted January 25, 2019 Read the section on Dim / Global / Local / Const in the help file and you will see when it is appropriate and when it is now. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
gahhon Posted January 25, 2019 Author Posted January 25, 2019 I have tried, and it refresh the current page but not open new tab. Func Yahoo() CheckIEExist("https://https://malaysia.yahoo.com/?p=us/") EndFunc Func Google() CheckIEExist("https://www.google.com/") EndFunc Func CheckIEExist($URL) If ProcessExists("IExplore.exe") Then _IENavigate($oBrowser, $URL) Else $oBrowser = _IECreate($URL) EndIf EndFunc
FrancescoDiMuro Posted January 25, 2019 Posted January 25, 2019 @gahhon Read carefully the Help file. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
gahhon Posted January 25, 2019 Author Posted January 25, 2019 10 minutes ago, FrancescoDiMuro said: @gahhon Read carefully the Help file. LoL. It said redirect to specific URL with current one. But I did search Google, it showed me _IENavigate.
gahhon Posted January 26, 2019 Author Posted January 26, 2019 May I know what function i should look afteR?
Nine Posted January 26, 2019 Posted January 26, 2019 You can also look at WinList (see example 2 - excluding Scite 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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
gahhon Posted January 27, 2019 Author Posted January 27, 2019 Okay. So now I can Navigate to new URL with new TAB. But how am I able to control their HTML elements? Any advise
Danp2 Posted January 27, 2019 Posted January 27, 2019 Read the help file, specifically the entries related to the _IE functions. Latest Webdriver UDF Release Webdriver Wiki FAQs
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