water Posted May 8, 2013 Share Posted May 8, 2013 Anyone? i need to know how to open the $oLink in another tab.. thanksPlease wait at least 24 hours before you bump a thread. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted May 8, 2013 Share Posted May 8, 2013 Try this, which is adapted from code found elsewhere on the forum: Const $navOpenInNewTab = 0x0800 Const $navOpenInBackgroundTab = 0x1000 Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks $href = $oLink.href If StringInStr($href, "example1") Then $oIE.navigate ( $href, $navOpenInNewTab ) EndIf Next Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
M4th3u534 Posted May 9, 2013 Author Share Posted May 9, 2013 Try this, which is adapted from code found elsewhere on the forum:Const $navOpenInNewTab = 0x0800 Const $navOpenInBackgroundTab = 0x1000 Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks $href = $oLink.href If StringInStr($href, "example1") Then $oIE.navigate ( $href, $navOpenInNewTab ) EndIf NextThanks man, it actually works.. the problem is its when it opens the links then it keep opening links that are on the other tabs.. and that is like an endless loop.. and i want to open links from the first page only.. thanks man hope u understand me! Link to comment Share on other sites More sharing options...
jdelaney Posted May 9, 2013 Share Posted May 9, 2013 (edited) doubt it...you must have a ton of links matching: use this to validate...if the coutner output is greater than the ubound, post back ConsoleWrite("total links = " & $oLinks.length & @CRLF) $iCounter = 1 For $oLink In $oLinks $href = $oLink.href If StringInStr($href, "example1") Then ConsoleWrite($iCounter & @CRLF) $oIE.navigate ( $href, $navOpenInNewTab ) EndIf $iCounter +=1 Next Edited May 9, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
M4th3u534 Posted May 9, 2013 Author Share Posted May 9, 2013 doubt it...you must have a ton of links matching:use this to validate...if the coutner output is greater than the ubound, post backConsoleWrite("total links = " & $oLinks.length & @CRLF) $iCounter = 1 For $oLink In $oLinks $href = $oLink.href If StringInStr($href, "example1") Then ConsoleWrite($iCounter & @CRLF) $oIE.navigate ( $href, $navOpenInNewTab ) EndIf $iCounter +=1 NextThanks for the reply, but i end up with this error:Variable used without being declared.: ConsoleWrite("total links = " & $oLinks.length & @CRLF) ConsoleWrite("total links = " & ^ ERRORAgain thanks for the support. Link to comment Share on other sites More sharing options...
jdelaney Posted May 9, 2013 Share Posted May 9, 2013 that was just a snippet, you have to logically replace the loop provided in post #22 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
M4th3u534 Posted May 9, 2013 Author Share Posted May 9, 2013 Oh.. damn i wouldnt know how to do that.. can you help me? (sorry for being so annoying.. i just need it =/) Link to comment Share on other sites More sharing options...
jdelaney Posted May 9, 2013 Share Posted May 9, 2013 look at post 22, and 24...make the changes to make 22 look like 24 You seem to just be copy/pasting, but you need to figure out what functions do IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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