DaLiMan Posted October 14, 2018 Share Posted October 14, 2018 Hi, I'm trying to figure out how to click on the <span> highlighted in the picture. I thought I needed to get the <DIV> and then get al the <td> but this is not working. The value of the title are created by the website based on a given value in a searchbox. Therefore I need to check if the value of the span is the right one and then click it if so. Both give back an object, but i'm not getting any good results. Any ideas? Local $oSearch = _IEGetObjById($oIE, 'form3_ProductHierarchy_SELECTOR') ConsoleWrite("$oSearch IsObj : " & IsObj($oSearch) & @CRLF) Local $oTable = _IETagNameGetCollection($oSearch, "td") ConsoleWrite("$oTable IsObj : " & IsObj($oSearch) & @CRLF) For $oTD in $oTable ConsoleWrite("$oTD: " & $oTD.value & @CRLF) Next Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 14, 2018 Share Posted October 14, 2018 (edited) @DaLiMan Did you already try with taking collection of <span> elements, and ConsoleWrite() the title property of all of them? Edited October 14, 2018 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Danp2 Posted October 14, 2018 Share Posted October 14, 2018 Hard to say with the details supplied thus far. Is this a publicly accessible site? If so, what's the URL? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DaLiMan Posted October 14, 2018 Author Share Posted October 14, 2018 @FrancescoDiMuro Sometimes it's just that simple.... Thanks for setting me back on track. @Danp2 No, it's an environment at work. I didn't realize span could be collected too. Now the code is looking like this. The hard coded value's are ultimately to be $variables. Local $oSearch = _IEGetObjById($oIE, 'form3_ProductHierarchy_SELECTOR') ConsoleWrite("$oSearch IsObj : " & IsObj($oSearch) & @CRLF) Local $oTable = _IETagNameGetCollection($oSearch, "span") ConsoleWrite("$oTable IsObj : " & IsObj($oSearch) & @CRLF) For $oTD in $oTable ConsoleWrite("$oTD: " & $oTD.title & @CRLF) If StringInStr($oTD.title,"254701") > 0 Then _IEAction($oTD, "focus") _IEAction($oTD, "click") ExitLoop EndIf Next Thank you both. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 14, 2018 Share Posted October 14, 2018 @DaLiMan Happy to have helped Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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