Stale element exception will occur when element is identified in DOM(document object model) but does not find in UI(User Interface). Since you are facing issue with loading pages try to add explicit wait in selenium and wait for the page load. Here is an example code in java
<code>WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
</code>WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("myElement")));
Following tutorial has details about how to handle stale element exception, go through it for help: https://www.testingtalkslatest.com/2025/09/22/what-is-stale-element-exception-in-selenium-and-handling-it/
sukanya meruva Answered question