Giter VIP home page Giter VIP logo

Comments (4)

stepva avatar stepva commented on August 22, 2024

I have a similar issue, but only when trying to run the auth from an installed package -> then it fails with Can't connect to web browser. Please install Chrome, Chromium or Firefox.
However, when I just clone the repo and run it locally with python3 lidlplus/__main__.py auth it works smoothly and without issues.
I'm running it on maxOS Monterey 12.5.1, installing the package via pip.
I'd try to look into it more, but it's difficult to debug, as it runs without issues locally. Figured I would at least write it here to help someone.

from lidl-plus.

MStrecke avatar MStrecke commented on August 22, 2024

Same problem here on my Linux box.

So I cloned the repo and tweaked it until it worked.

lidlplus uses Selenium. I'm also using Selenium in other projects. So, this package was already installed.
However the minimal Selenium program (two lines in a Python console) failed:

from selenium import webdriver
driver = webdriver.Firefox()

The geckodriver version (0.29.1) detected in PATH at /home/XXXX/bin/geckodriver might not be compatible with the detected firefox version (118.0.1); currently, geckodriver 0.33.0 is recommended for firefox 118.*, so it is advised to delete the driver in PATH and retry

The solution is simply enough: download the current geckodriver from the Mozilla project and try again. The two-liner worked.

After that I changed the lidl-plus source code in the file api.py. In the procedure _init_firefox I commented out three parameters that apparently don't exist anymore. (I tried using them in the two-liner and Python complained.)

        return webdriver.Firefox(
            # executable_path=GeckoDriverManager().install(),
            # firefox_binary="/usr/bin/firefox",
            options=options,
            # firefox_profile=profile,
        )

The superfluous parameters made the function call fail which was interpreted as "Firefox is not installed".

Please note that lidl-plus tries to connect to Chrome first before it tries to connect to Firefox and the timeout is about half a minute. So, be patient.

I temporarily changed options.headless to False three lines earlier in order to see the Firefox window pop up and to observe the interaction. You have to remember however that the PIN that you get on your mobile has to be entered in the command line window not into Firefox.

  • After cloning the repo change into its folder (in my case lidl-plus (with an -)).
  • From there change into lidlplus (without the -) and modify api.py.
  • Go back to the parent folder and call the script like
lidlplus/__main__.py auth
lidlplus/__main__.py --language=de --country=DE --refresh-token=XXXXXX receipt --all > data.json

from lidl-plus.

adithya995 avatar adithya995 commented on August 22, 2024

Will this work in a native app in headless mode? So far I was unsuccessful. It either fails to get a driver or selenium times out.

from lidl-plus.

Kuba314 avatar Kuba314 commented on August 22, 2024

@adithya995 What exactly do you mean by "native app" and "headless mode"? What are the exact errors you're getting when you say "fails to get a driver" and "selenium times out"?

from lidl-plus.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.