diff --git a/deletefb/tools/likes.py b/deletefb/tools/likes.py index 3adb151..9533eaa 100644 --- a/deletefb/tools/likes.py +++ b/deletefb/tools/likes.py @@ -64,13 +64,17 @@ def unlike_page(driver, url, archive=None): print("Unliking {0}".format(url)) - wait = WebDriverWait(driver, 30) + wait = WebDriverWait(driver, 60) actions = ActionChains(driver) - wait.until( - EC.presence_of_element_located((By.XPATH, "//*[text()='Liked']")) - ) + try: + wait.until( + EC.presence_of_element_located((By.XPATH, "//*[text()='Liked']")) + ) + except SELENIUM_EXCEPTIONS: + # Something went wrong with this page, so skip it + return button = driver.find_element_by_xpath("//*[text()='Liked']")