avidovi Posted March 5, 2014 Posted March 5, 2014 Hello all, i need to run a test on a web site: "http://www.equities.com/directories/hedge-funds" so obviously i used: Local $oIE = _IECreate("http://www.equities.com/directories/hedge-funds") but now i need to click every box in the page (Total of 15) and click the one by one. i cannot get the data to click them. Can anyone help?? Thank in advance
Moderators Melba23 Posted March 5, 2014 Moderators Posted March 5, 2014 avidovi,Please do not bump your own threads within 24 hours. Remember that this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. Although the problem might be urgent to you, it is not to anyone else. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
cascius Posted March 6, 2014 Posted March 6, 2014 (edited) Look in the help file for a function called: _IELinkGetCollection() In the help there's the following example: #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IE_Example("basic") Local $oLinks = _IELinkGetCollection($oIE) Local $iNumLinks = @extended Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF For $oLink In $oLinks $sTxt &= $oLink.href & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Link Info", $sTxt) Then you could just use the function _IEAction() to click each link. Something like this maybe: #include <IE.au3> Local $oIE = _IECreate("http://www.equities.com/directories/hedge-funds") Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks _IEAction($oLink,"Click") Next I hope this makes sense. - Cascius PS: I haven't tested this script, but got a feeling it should work as is. Edited March 6, 2014 by cascius
avidovi Posted March 6, 2014 Author Posted March 6, 2014 Thanks for the reply, But how do i know on where the script clicked? i need to click all of the boxes in a loop..
avidovi Posted March 6, 2014 Author Posted March 6, 2014 OK i tried the example from "Cascius" and i know the links i need to click. the problem is how do i isolate those links: http://www.equities.com/hedge-funds/2485-1492-capital-management http://www.equities.com/hedge-funds/1964-1607-capital-partners http://www.equities.com/hedge-funds/2594-1794-commodore-funds http://www.equities.com/hedge-funds/2595-1798-global-partners http://www.equities.com/hedge-funds/1491-2100-xenon-group http://www.equities.com/hedge-funds/2397-2nd-generation-capital http://www.equities.com/hedge-funds/2596-3-sigma-value-management http://www.equities.com/hedge-funds/3544-3-sisters-sustainable-management http://www.equities.com/hedge-funds/2597-360-global-capital http://www.equities.com/hedge-funds/1821-361-capital http://www.equities.com/hedge-funds/3996-3g-capital-management http://www.equities.com/hedge-funds/2598-3g-capital-partners http://www.equities.com/hedge-funds/2282-440-investment-group http://www.equities.com/hedge-funds/2599-47-degrees-north-capital-management http://www.equities.com/hedge-funds/1979-515-capital-management from all the others in orders to click them one by one??
Danp2 Posted March 6, 2014 Posted March 6, 2014 Here's one way to accomplish this: #include <IE.au3> Local $oIE = _IECreate("http://www.equities.com/directories/hedge-funds") Local $oDiv = _IEGetObjById($oIE, 'jr-listing-column') Local $oLinks = _IETagNameGetCollection($oDiv, 'a') For $oLink In $oLinks ConsoleWrite($oLink.href & @CRLF) Next Latest Webdriver UDF Release Webdriver Wiki FAQs
Solution avidovi Posted March 8, 2014 Author Solution Posted March 8, 2014 work Like a charm thanks Danp2 and Cascius
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