Forum Discussion
Hi baxatob ,
That one is dynamically created , so not static.
Also I have other cases where there is completely no ID.
I tried that code in Chrome and it works perfectly fine, so Javascript-syntax-wise should be all right. Not sure why TC doesn't like it.
Thank You.
Try to iterate using:
...querySelector(CSS_selector).children.item(index). ... .textContent
- coffee10 years agoContributor
Thank you very much baxatob
The solution does work. :smileyhappy:
I am just wondering why TC use different method than native Javascript.
Is there any article/documentation about children.item(i)? Just want to dig further about this method and how TC explore the DOM. I assume there are other methods that TC uses differently than the native Javascript? Thanks.
- baxatob10 years agoCommunity Hero
children property (as well as the item() method) - also native JavaScript, you can find more here >>
- coffee10 years agoContributor
Thank You HKosova , your solution also works fine. But sometimes it can be difficult to QuerySelector if the properties are not unique and can't be made unique. Anyway, having more than one working methods would always be good :) Thanks.
HKosova wrote:Hi coffee,
Just out of curiosity, why don't you search for the target INPUT object directly? Doesn't it have some combination of properties that make it unique? For example:
var obj = Page.QuerySelector("input.validate[type='hidden']"); Log.Message(obj.value);