From 5e1b0e1eb0d3e8fb2cab4ec2aa0c3607974f241e Mon Sep 17 00:00:00 2001 From: KarmaKamikaze Date: Wed, 27 Mar 2024 14:32:09 +0100 Subject: [PATCH] Update script to run with new site options --- moxfield_scraper.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/moxfield_scraper.py b/moxfield_scraper.py index 589ce79..61a8358 100644 --- a/moxfield_scraper.py +++ b/moxfield_scraper.py @@ -57,6 +57,8 @@ def __init__(self, name: str, url: str, config: Settings): self.__config.webdriver_path, options=options, ) + # Set the implicit wait time + #self.__driver.implicitly_wait(20) def __log(self, message: str) -> None: self.logger.info(message) @@ -80,11 +82,11 @@ def __login(self, username: str, password: str) -> None: EC.presence_of_element_located( ( By.CSS_SELECTOR, - "#userhover-popup-1 > a", + "#userhover-popup-2 > a", ) ) ) - self.deck_author = self.__driver.find_element_by_css_selector("#userhover-popup-1 > a").text + self.deck_author = self.__driver.find_element_by_css_selector("#userhover-popup-2 > a").text self.__log(f"Deck: {self.deck_title} by {self.deck_author}.") if username == "" or password == "": @@ -139,13 +141,13 @@ def __set_price_to_lowest(self) -> None: ( By.CSS_SELECTOR, "body > div.dropdown-menu.show > div > div > div.d-inline-block.dropdown-column-divider > " - "a:nth-child(6)", + "a:nth-child(7)", ) ) ) set_to_lowest_box = self.__driver.find_element_by_css_selector( "body > div.dropdown-menu.show > div > div > div.d-inline-block.dropdown-column-divider > " - "a:nth-child(6) " + "a:nth-child(7) " ) set_to_lowest_box.click() WebDriverWait(driver=self.__driver, timeout=5).until(