Skip to content

Bypass new login window#25

Open
morzen7 wants to merge 2 commits intoAndre0512:mainfrom
morzen7:main
Open

Bypass new login window#25
morzen7 wants to merge 2 commits intoAndre0512:mainfrom
morzen7:main

Conversation

@morzen7
Copy link
Copy Markdown

@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
Copy Markdown
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)

Comment thread lidlplus/api.py
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
Copy Markdown

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.

Comment thread lidlplus/api.py
self._click(browser, (By.CLASS_NAME, "role_next"))

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

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): ")

@Kepilif
Copy link
Copy Markdown

Kepilif commented May 2, 2026

Hi,

I tried to use this fork on both Windows and Linux, but login still does not work.

Environment

  • Windows 11 + conda env (Python 3.11)
  • Chrome 147 + chromedriver (manual setup)
  • selenium-wire + blinker==1.7.0 (fixed import issue)

What works

  • Selenium + ChromeDriver works correctly (manual test OK)
  • API calls work when using a valid refresh token

Problem

Login flow via Selenium fails:

  • On some attempts:
    "Can't connect to web browser"
  • After fixes:
    TimeoutException waiting for elements like:
    • button_welcome_login
    • 2FA elements (phone / email)

Also, when browser opens manually, Lidl shows:
"Przekroczyliśmy nasze możliwości, spróbuj ponownie później"

This suggests:

  • UI selectors are outdated
  • Lidl changed login flow
  • Selenium is likely detected and blocked

Conclusion

It seems that Selenium-based login is no longer reliable.

Suggestion

Maybe it would be better to:

  • skip UI login entirely
  • support using existing refresh_token only
  • or document how to extract token manually

Let me know if you need more logs.

Thanks for your work!

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.

3 participants