XaelloNegative Posted January 9, 2018 Posted January 9, 2018 Hi there. Im having some kind of a coder block here, <td class="treeview ctl00_CenterContent_objTreeView_2" style="white-space:nowrap;"> <input type="checkbox" name="ctl00_CenterContent_objTreeViewn1CheckBox" id="ctl00_CenterContent_objTreeViewn1CheckBox"> <span class="ctl00_CenterContent_objTreeView_0 treeview ctl00_CenterContent_objTreeView_1" id="ctl00_CenterContent_objTreeViewt1" style="border-style:none;font-size:1em;"> <i class="fa fa-file-code-o fa-fw"> </i> <span data-placement="bottom" data-toggle="tooltip" title="" data-original-title="Tool tip for said part">REFUNDS</span></span></td> this is a code directly from the website im working with. I was thinking of inserting a javascript that would get the "REFUNDS" part. Any ideas on how to do so? Any thoughts will be highly appreciated. ~XN~
Danp2 Posted January 9, 2018 Posted January 9, 2018 Perhaps you can elaborate on what you are trying to accomplish because I don't understand why you would want to insert javascript here. Are you just trying to retrieve the innertext of this span? Or something else? Latest Webdriver UDF Release Webdriver Wiki FAQs
XaelloNegative Posted January 9, 2018 Author Posted January 9, 2018 Just now, Danp2 said: Perhaps you can elaborate on what you are trying to accomplish because I don't understand why you would want to insert javascript here. Are you just trying to retrieve the innertext of this span? Or something else? Thanks for the quick reply Danp2. To answer the question, YES!. I just wanna get that innertext of that span. I was actually trying to have it done by creating a div that would get that refunds part and do it like this var nextSpan = $(e.target).next() if(nextSpan){ nextSpan.find("i").remove() etc etc. but couldn't get it to work. nonetheless. ~XN~
Danp2 Posted January 9, 2018 Posted January 9, 2018 Untested, but something like this should work -- $oSpan = _IEGetObjById($oIE, 'ctl00_CenterContent_objTreeViewt1') $oSpan2 = _IETagNameGetCollection($oSpan, 'span', 0) $sResult = _IEPropertyGet($oSpan2, 'innertext') ConsoleWrite("result = " & $sResult & @CRLF) Latest Webdriver UDF Release Webdriver Wiki FAQs
XaelloNegative Posted January 9, 2018 Author Posted January 9, 2018 16 minutes ago, Danp2 said: Untested, but something like this should work -- $oSpan = _IEGetObjById($oIE, 'ctl00_CenterContent_objTreeViewt1') $oSpan2 = _IETagNameGetCollection($oSpan, 'span', 0) $sResult = _IEPropertyGet($oSpan2, 'innertext') ConsoleWrite("result = " & $sResult & @CRLF) Result = 0 ~XN~
XaelloNegative Posted January 9, 2018 Author Posted January 9, 2018 Ill just lay it out here, as you can see from the input part of the my script above, im working with a treeview with checkboxes on IE. Is there anyway that i could detect which particular checkbox has been clicked? just ideas. thank you. (do remind me if I need to open a separate thread for this) ~XN~
Danp2 Posted January 9, 2018 Posted January 9, 2018 If you want further help, post the Scite output showing any errors that occurred. ;-) 10 minutes ago, XaelloNegative said: Result = 0 XaelloNegative 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
Danp2 Posted January 9, 2018 Posted January 9, 2018 You can use _IEFormElementCheckBoxSelect to determine the checked state of a checkbox element. XaelloNegative 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
XaelloNegative Posted January 9, 2018 Author Posted January 9, 2018 ill try to check the _IEFormElementCheckBoxSelect later on as well as the error. Im currently on my way to take my dinner (Philippines ) will be back. thank you so much Danp2. ~XN~
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