mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 02:31:45 +01:00
Fixed no element error when shipping type is pickup.
This commit is contained in:
committed by
Sebastian Thomschke
parent
55d8cc124b
commit
4f76007c7a
@@ -531,11 +531,12 @@ class KleinanzeigenBot(SeleniumMixin):
|
||||
#############################
|
||||
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, "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")]')
|
||||
if ad_cfg["shipping_type"] == "SHIPPING":
|
||||
if sell_directly and ad_cfg["shipping_options"] and price_type in {"FIXED", "NEGOTIABLE"}:
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user