Skip to content

Commit

Permalink
Update script to run with new site options
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaKamikaze committed Mar 27, 2024
1 parent 296e3be commit 5e1b0e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions moxfield_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 == "":
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 5e1b0e1

Please sign in to comment.