Skip to content

Conversation

morzen7
Copy link

@morzen7 morzen7 commented Jan 4, 2025

The new change can do the login.
Important! For me there was no 2 factor authentication, and worked only with email, so this version works with the email. If your country has 2nd factroy, than maybe some other changes might need.

I tried it with hungarian login, it worked, but I don't have 2 factor authenticaiton in here, so some aditional change might needed. It uses XPATH instead of ID.
@morzen7
Copy link
Author

morzen7 commented Jan 4, 2025

if this is not working change the api.py line 214, the headles to False, like this:
browser = self._get_browser(headless=kwargs.get("headless", False))

and change timeout in 216 to a higher time, like this:
wait = WebDriverWait(browser, 100)

this way, you will see the window, and will have time for check, what is the difference ( with F12)

wait.until(expected_conditions.element_to_be_clickable((By.ID, "field_Password"))).send_keys(password)
self._click(browser, (By.ID, "button_submit"))
wait.until(expected_conditions.visibility_of_element_located((By.XPATH, '//*[@id="duple-button-block"]/button[1]/span'))).click()
#wait.until(expected_conditions.visibility_of_element_located((By.NAME, "EmailOrPhone"))).send_keys(phone)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is this comment for? Did you forget to remove it? If not, please explain its purpose in the code.

@@ -209,21 +209,16 @@ def _check_2fa_auth(self, browser, wait, verify_mode="phone", verify_token_func=
browser.find_element(By.NAME, "VerificationCode").send_keys(verify_code)
self._click(browser, (By.CLASS_NAME, "role_next"))

def login(self, phone, password, **kwargs):
def login(self, email, password, **kwargs):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The login form now seems to require email instead of phone. Could you also replace all other occurences of this (e.g. in the login CLI) where there's "phone" to "email"?

I can see at least one occurence, where the variable should probably be named email and the (phone number) part of the string should be changed to (email).

username = args.get("user") or input("Enter your lidl plus username (phone number): ")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants