Skip to content

Commit

Permalink
Fixes #217, #214, #200, #195 (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
DreckSoft authored Oct 20, 2023
1 parent 5d3104f commit 0841b7c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kleinanzeigen_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def publish_ad(self, ad_file:str, ad_cfg: dict[str, Any], ad_cfg_orig: dict[str,
self.__set_shipping_options(ad_cfg)
else:
try:
self.web_click(By.XPATH, '//*[contains(@class, "SelectionButton--Right")]')
self.web_click(By.XPATH, '//*[contains(@class, "jsx-2623555103")]')
self.web_click(By.XPATH, '//*[contains(@class, "CarrierSelectionModal--Button")]')
self.web_click(By.XPATH, '//*[contains(@class, "CarrierOption--Main")]')
if ad_cfg["shipping_costs"]:
Expand All @@ -532,10 +532,10 @@ def publish_ad(self, ad_file:str, ad_cfg: dict[str, Any], ad_cfg_orig: dict[str,
sell_directly = ad_cfg["sell_directly"]
try:
if sell_directly and ad_cfg["shipping_type"] == "SHIPPING" and ad_cfg["shipping_options"] and price_type in {"FIXED", "NEGOTIABLE"}:
if not self.webdriver.find_element(By.ID, "buy-now-toggle").is_selected():
self.web_click(By.XPATH, '//*[contains(@class, "BuyNowSection")]//div[contains(@class, "Toggle--Slider")]')
elif self.webdriver.find_element(By.ID, "buy-now-toggle").is_selected():
self.web_click(By.XPATH, '//*[contains(@class, "BuyNowSection")]//span[contains(@class, "Toggle--Slider")]')
if not self.webdriver.find_element(By.ID, "radio-buy-now-yes").is_selected():
self.web_click(By.XPATH, '//*[contains(@id, "radio-buy-now-yes")]')
elif not self.webdriver.find_element(By.ID, "radio-buy-now-no").is_selected():
self.web_click(By.XPATH, '//*[contains(@id, "radio-buy-now-no")]')
except NoSuchElementException as ex:
LOG.debug(ex, exc_info = True)

Expand Down Expand Up @@ -566,7 +566,7 @@ def publish_ad(self, ad_file:str, ad_cfg: dict[str, Any], ad_cfg_orig: dict[str,
#############################
# set contact name
#############################
if ad_cfg["contact"]["name"]:
if ad_cfg["contact"]["name"] and not self.webdriver.find_element(By.ID, "postad-contactname").get_attribute("readonly"):
self.web_input(By.ID, "postad-contactname", ad_cfg["contact"]["name"])

#############################
Expand Down

0 comments on commit 0841b7c

Please sign in to comment.