whole-foods-deliverance icon indicating copy to clipboard operation
whole-foods-deliverance copied to clipboard

ARM alternative to chromedriver-binary?

Open rgov opened this issue 4 years ago • 9 comments

The chromedriver-binary package only includes an x86_64 binary, so this can't be run on a Raspberry Pi or other ARM system.

/usr/local/lib/python3.6/dist-packages/chromedriver_binary/chromedriver: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=59cd88aeed037aaa10f05efbd725908f3f982ea3, stripped

Is there an alternative?

rgov avatar Apr 13 '20 20:04 rgov

Apparently yes: https://stackoverflow.com/questions/38732822/compile-chromedriver-on-arm

I was able to just use apt install chromium-driver and then presumably the resulting tool is already in $PATH so it's not necessary to do anything else.

rgov avatar Apr 13 '20 20:04 rgov

Interesting. Does this fail at any stage using chromedriver-binary as it is in the repo now? Specifically, does importation append the wrong binary to the front of $PATH?

mark-thompson avatar Apr 13 '20 23:04 mark-thompson

Well if you install chromedriver-binary it will give you a chromedriver that cannot be executed so as soon as the code calls this tool, it will fail.

rgov avatar Apr 13 '20 23:04 rgov

Right, totally get that, but does the code in this repo work as-is, assuming you've installed chromium-driver via apt? Or does the importation of chromedriver-binary alter PATH such that it tries to use the x86 binary and fails?

mark-thompson avatar Apr 14 '20 00:04 mark-thompson

Ah, right. chromedriver-binary prefixes PATH so it would seem that the kernel will attempt to launch the x86 binary before the installed package.

I haven't tried yet because this doesn't support logging into Amazon, it expects Chrome is already logged in, so I wasn't able to use it in the headless manner I expected.

rgov avatar Apr 14 '20 00:04 rgov

Yeah, I thought that might be the case. A conditional import based on platform.machine() may be a viable option, though that doesn't help with the headless bit.

I had thought about automating the login process - sending values to elements is easy enough, but things get complicated when you've either enabled, or Amazon forces OTP.

mark-thompson avatar Apr 14 '20 00:04 mark-thompson

Can I just copy cookies from a logged in browser on another machine?

rgov avatar Apr 14 '20 01:04 rgov

I can confirm that the chromedriver.exe placed in the folder with the script is getting executed before chromedriver-binary. So it should be easy to override it with whatever other driver one may want.

eoprede avatar Apr 14 '20 01:04 eoprede

@rgov I looked into that initially, but there are various hoops one has to jump through to programmatically access profile protected storage (cookes, localStorage, etc.). On OSX anyway, it requires access to the Chrome Safe Storage keychain item.

You may be able to do this manually, however, or by running a Selenium instance on the authenticated machine, using your authenticated chrome profile (via the user-data-dir argument to ChromeOptions), then using something like utils.store_session_data from this repo.

mark-thompson avatar Apr 14 '20 22:04 mark-thompson