Title basically, getting a StaleElementReferenceException while trying to access the “Raw” button on GitHub using Selenium.
.types__StyledButton-sc-ws60qy-0 and .dupbIv are the classes of the button I am trying to click on.
What exactly could be causing this?
def clickRaw(file_path):
driver.get(file_path)
delay = 10
try:
raw = WebDriverWait(driver, delay).until(EC.presence_of_element_located((By.CSS_SELECTOR, ".types__StyledButton-sc-ws60qy-0.dupbIv")))
raw.click()
except selenium.common.exceptions.TimeoutException:
print("Too much time")
return
pageSource = driver.page_source
pageSource = f"{pageSource}"
if "password" in pageSource:
print(f"Password found @: {file_path}")
I was trying to have selenium click on the “Raw” button, and it resulted in a StaleElementReferenceException
New contributor
Jay Balwani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.