My aim is to extract the url of each title for every page (using find elements + click). When it comes to turn the page, it fails at the second iteration and it gives the following error message:
ERROR Click 0:28 Execute failed: stale element reference: element is not attached to the page document
Firstly, I thought that the name or class of the element had changed, but it's not the case; in fact, the find elements node gives the expected result. I've tried to add a wait node, but it didn't improve the result.
This problem happens, when you try to interact with an element which is not on the current page. E.g. you extracted an element using the 'Find elements' node, then a page-load happened, and after that you try to click the element.
Two solutions: Either increase the waiting time in the 'Wait' node or use a condition in the 'Find elements' node where you wait for an element to appear.
Thanks Philipp. The oddest thing is that it finally worked (more or less) when I erased the wait node. In any case, the webpage itself seems to be somewhat inestable when it comes to execute Selenium on it, which I suppose is relatively common, according to my own experience.
I didn't have much time yesterday to check in detail, but the website seemed to have pretty long (and varying) loading times. In that case, workflows may obviously fail, in case the page takes more time to load then the specified waiting or timeout interval.
As mentioned, the "Find element" node provides some timeout setting which allows to wait for a certain element to appear on the webpage. This might already help to make your workflow more robust.
We're also currently working on additional conditional logic, which allows to specify further preconditions to be fulfilled, until the workflow continues execution, e.g. to wait for a value on a page to appear (the current "Wait" node is in that regard a very "dumb" mechanism). Stay tuned!
i have anothor problem , i want to take data from a website, "find elements" node waits a long time and doesnnt do anything it waits 24 hours and doesnt do anything, i have for example 500 clicks 20 000 comments it works firstly and "find elements" works after the 150 clicks it doesnt do anything