diff --git a/kleinanzeigen_bot/__init__.py b/kleinanzeigen_bot/__init__.py index 9874ffb..e465d58 100644 --- a/kleinanzeigen_bot/__init__.py +++ b/kleinanzeigen_bot/__init__.py @@ -815,8 +815,11 @@ class KleinanzeigenBot(SeleniumMixin): Downloads an ad to a specific location, specified by config and ad_id. """ - # create sub-directory for ad to download + # create sub-directory for ad to download: relative_directory = str(self.config['ad_files'][0]).split('**', maxsplit=1)[0] + # make sure configured base directory exists + if not os.path.exists(relative_directory) or not os.path.isdir(relative_directory): + os.mkdir(relative_directory) new_base_dir = os.path.join(relative_directory, f'ad_{self.ad_id}') if os.path.exists(new_base_dir): LOG.info('Deleting current folder of ad...') diff --git a/kleinanzeigen_bot/extract.py b/kleinanzeigen_bot/extract.py index 209e661..ba4fb8f 100644 --- a/kleinanzeigen_bot/extract.py +++ b/kleinanzeigen_bot/extract.py @@ -143,7 +143,7 @@ class AdExtractor: phone_number = phone_element.find_element(By.TAG_NAME, 'a').text contact['phone'] = ''.join(phone_number.replace('-', ' ').split(' ')).replace('+49(0)', '0') except NoSuchElementException: - contact['phone'] = None # phone seems to be a deprecated feature + contact['phone'] = None # phone seems to be a deprecated feature (for non-professional users) # also see 'https://themen.ebay-kleinanzeigen.de/hilfe/deine-anzeigen/Telefon/ return contact