I’m locating my web elements, but I can’t see “sign-in” button in(find elements node).
Could you help me please?
The button is obviously located in a “shadow DOM”, see the
I have given some input how to deal with this in the following forum thread:
As I see that KNIME is whole nodes.
Working with code, can be more simply for me.
You can use this node to execute JS which would usually run in the browser:
PS: As a side node (though not really relevant here): You can even execute Java code to access the full Selenium API. This is possible with the regular KNIME Java Snippet node. You can double click on a
WebElement input in the node configuration, access their Java API just as in code using the Selenium library, and also return
WebElement values. A simple example how to achieve this is available e.g. here:
I did what you adviced, thank you so much.
But I couldn’t locate shadow root element unfortunately
Find elements node is empty , I can’t locate “Sign-in” element to inside.
Image is above from inside of JS Execute Node
What can I do?
So simple point but I can’t proceed.
I appricate for everything
You’ll need to select the proper input argument (one of the entries with the mouse cursor icon, which represent
WebElements) in the left column using a checkbox.
The selected items will be assigned to the
arguments array in the JS code.
Hope this helps!
 Also make sure to select the proper return type in the lower left corner - as you’re returning a
WebElement chose this in the “Return type” menu.
I see you.
My real problem is that;
I couldn’t assign my element into input arguments(on th left side).
I need to locate "shadow root " element and add the list.
Afterthat I can apply JS execute.
You can do that using a Find Elements node, where you select the shadow DOM container - in your case this is obviously that
Or instead, query for the shadow DOM container directly via JS code. Instead of …
const shadowDomContainer = arguments;
… do something like …
const shadowDomContainer = document.querySelector('ep-button');
If this doesn’t work, please attach the current version of your workflow, this makes it easier to help and for others to jump in.
Bbecause, KNIME Selenium Nodes can’t see any shadow DOM.
So it doesn’t locate any element, because of that can’t click “Sign in” button.
Would you please attach the workflow as file (i.e.
cars.com_extract_list.knwf (24.2 KB)
This is my workflow .
Thank you - the DOM contains a nested shadow DOM, i.e. a shadow DOM within a shadow DOM. You’ll notice this if you carefully inspect the page structure from the button “upwards”.
Thus you’ll need to adapt the code to query twice into the shadow root:
const outerShadowDomContainer = document.querySelector('cars-auth-modal'); const innerShadowDomContainer = outerShadowDomContainer.shadowRoot.querySelector('ep-button[type="submit"]'); const submitButton = innerShadowDomContainer.shadowRoot.querySelector('button[type="submit"]'); // result will be the retrieved WebElement return submitButton;
Hi @qqilihq ;
I’m doing what you say but it doesn’t.
Please Could you share with me as a workflow file you did and works.
I so thank you
@Sezgin I uploaded the workflow to my NodePit Space for you:
I know taht , You’re so tired from my questions.
So sorry for that. But it doesn’t your workflow my PC.
Is it working on your PC?
Yes, it works fine for me.
The shown error message is quite common with Selenium and I think we also discussed it here already in the forum once.
Essentially, make sure that the button which you’re trying to click is visible in the window: (a) browser window should be big enough or you need to scroll the button into the view, and/or (b) window should not be obscured by other overlays (such as cookie ), etc.
My Problem is most probably "SMALL WINDOW;
I couldn’t any settings for maximize window.
Where is the settings for maximize window
There’s a Window node for that:
I did it. but didn’t click.
I will apply Your other advice (scroll down)
Where is the scroll node?
Please search in the forum for
selenium scroll – it’ll give you several ideas.