You are sleeping after you are attempting to click the button. You are also quitting the driver before sleeping which is another problem.
Consider using the WebDriverWait().until() function to ensure that the element is loaded instead of relying on some arbitrary amount of time:
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.XPATH, "//span[@class='RveJvd snByac' and text()='Zgadzam się']"))
)
driver.find_element_by_xpath("//span[@class='RveJvd snByac' and text()='Zgadzam się']").click()
The reason why you are getting this error is because the element is nested in an <iframe>. This can be resolved by waiting for the iframe to appear, then waiting for the button to be loaded, then finally clicking the button:
# Wait for the iFrame to be available to switch to it
WebDriverWait(driver, 10).until(
EC.frame_to_be_available_and_switch_to_it(0)
)
# Wait for the button to be available within that iframe
WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.XPATH, "//span[@class='RveJvd snByac' and text()='Zgadzam się']"))
)
# Finally click the button
driver.find_element_by_xpath("//span[@class='RveJvd snByac' and text()='Zgadzam się']").click()