mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
fix: logging file handler not closed on bot shutdown. Fixes #405
This commit is contained in:
@@ -60,6 +60,7 @@ class KleinanzeigenBot(WebScrapingMixin):
|
||||
def __del__(self) -> None:
|
||||
if self.file_log:
|
||||
LOG_ROOT.removeHandler(self.file_log)
|
||||
self.file_log.close()
|
||||
self.close_browser_session()
|
||||
|
||||
def get_version(self) -> str:
|
||||
@@ -707,7 +708,7 @@ class KleinanzeigenBot(WebScrapingMixin):
|
||||
await self.web_sleep(1) # Wait for city dropdown to populate
|
||||
options = await self.web_find_all(By.CSS_SELECTOR, "#pstad-citychsr option")
|
||||
for option in options:
|
||||
option_text = await self.web_text(By.CSS_SELECTOR, "option", parent=option)
|
||||
option_text = await self.web_text(By.CSS_SELECTOR, "option", parent = option)
|
||||
if option_text == ad_cfg["contact"]["location"]:
|
||||
await self.web_select(By.ID, "pstad-citychsr", option_text)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user