python-scraping
python-scraping copied to clipboard
Right code to raise StaleElementReferenceException
elem ==driver.find_element_by_tag_name('html') will just return True or False, but will never raise a StaleElementReferenceException. It will raise a StaleElementReferenceException when using elem to do something while it is not the original one due to the page changing.