I am trying to scrape this website link using RSelenium. I have successfully scraped most of the contents on the page but was trying to get through to the \"facility visits\
You are probably getting a StaleElementReference as a result of clicking the webElem
.
The webElem
element is likely modified in the DOM after the click, so if you try to "use" webElem
again, it is no longer attached to the DOM and is considered "stale".
An easy fix is to simply re-locate webElem
after it is clicked:
webElem <- rd$findElement(...
webElem$clickElement()
webElem <- rd$findElement(... # re-locate webElem
webElem$findElements('css',"#aspnetForm > div.page > div.main")