Execute failed: stale element reference: element is not attached to the page document

I'm experimenting certain problems while trying to extract data from

https://doaj.org/search?source=%7B%22query%22%3A%7B%22filtered%22%3A%7B%22filter%22%3A%7B%22bool%22%3A%7B%22must%22%3A%5B%7B%22term%22%3A%7B%22_type%22%3A%22article%22%7D%7D%5D%7D%7D%2C%22query%22%3A%7B%22query_string%22%3A%7B%22query%22%3A%22aspergillus%20niger%22%2C%22default_operator%22%3A%22AND%22%7D%7D%7D%7D%2C%22from%22%3A0%2C%22size%22%3A10%7D#.VwTzGZyLSHt

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.

any solution or explanation?

Thanks in advance

 

 

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.

Hope that helps,
Philipp

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.

Hey aff,

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!

Best,
Philipp

hello,

 

i am working with selenium nodes , how can i  solve " can not determine loading status"  

i am working with chrome and find elements node gives this error.

thanks.

Does this still happen with the latest release? If yes, please provide an example workflow.

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

That's too little information. As this is an entirely different issue, use a separate forum thread and give a detailed explanation.

Please give feedback about your first issue ("can not determine loading status"). Is this solved?