mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
Fix login check
This commit is contained in:
@@ -348,13 +348,16 @@ class KleinanzeigenBot(SeleniumMixin):
|
|||||||
self.browser_config.profile_name = self.config["browser"]["profile_name"]
|
self.browser_config.profile_name = self.config["browser"]["profile_name"]
|
||||||
|
|
||||||
def login(self) -> None:
|
def login(self) -> None:
|
||||||
LOG.info("Logging in as [%s]...", self.config["login"]["username"])
|
LOG.info("Checking if already logged in")
|
||||||
self.web_open(f"{self.root_url}/m-einloggen.html?targetUrl=/")
|
self.web_open(f"{self.root_url}")
|
||||||
|
|
||||||
if self.is_logged_in():
|
if self.is_logged_in():
|
||||||
LOG.info("Already logged in as [%s]. Skipping login.", self.config["login"]["username"])
|
LOG.info("Already logged in as [%s]. Skipping login.", self.config["login"]["username"])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
LOG.info("Logging in as [%s]...", self.config["login"]["username"])
|
||||||
|
self.web_open(f"{self.root_url}/m-einloggen.html?targetUrl=/")
|
||||||
|
|
||||||
# close redesign banner
|
# close redesign banner
|
||||||
try:
|
try:
|
||||||
self.web_click(By.XPATH, '//*[@id="pre-launch-comms-interstitial-frontend"]//button[.//*[text()[contains(.,"nicht mehr anzeigen")]]]')
|
self.web_click(By.XPATH, '//*[@id="pre-launch-comms-interstitial-frontend"]//button[.//*[text()[contains(.,"nicht mehr anzeigen")]]]')
|
||||||
|
|||||||
Reference in New Issue
Block a user