Original code credit: Omer Sakarya and Ken Jee.
try: WebDriverWait(driver, 30).until(EC.alert_is_present()) obj = driver.switch_to.alert obj.dismiss() except NoSuchElementException: pass
Unfortunately, the pop-up stays on the screen and 30 seconds passes resulting in a time-out. Any advice would be appreciated!
url='https://www.glassdoor.com/Job/' + keyword + '-jobs- SRCH_KO0,14.htm' driver.get(url) jobs =  try: driver.find_element(By.CSS_SELECTOR, '[data- selected="true"]').click() except ElementClickInterceptedException: pass try: WebDriverWait(driver, 30).until(EC.alert_is_present()) obj=driver.switch_to.alert obj.dismiss() except NoSuchElementException: print('x out failed') pass
try: driver.find_element(By.XPATH,('.//div[@id="JAModal"]//span[@alt="Close"]')).click() except NoSuchElementException: pass
I was able to solve this one through a lot of trial and error, thank you to everyone that helped!
Answered By – BuffaloJ