antonengelhardt / kicktipp-bot

A bot which can submit tips for a Kicktipp competition based on quotes.
MIT License
14 stars 5 forks source link

Error: 'str' object has no attribute 'capabilities #28

Closed tbrodbeck closed 3 months ago

tbrodbeck commented 3 months ago

Environment

Pre-Condition

➜  kicktipp-bot git:(main) docker pull ghcr.io/antonengelhardt/kicktipp-bot:amd64
amd64: Pulling from antonengelhardt/kicktipp-bot
no matching manifest for linux/arm64/v8 in the manifest list entries

Even though I am using a M1 Max Macbook, Docker is able running the amd64 image through emulation. (see below)

Expected Behavior

I just tried booting up the container.

Actual Behavior

kicktipp-bot git:(main) docker run -it --name kicktipp-bot --platform linux/amd64 --env-file .env ghcr.io/antonengelhardt/kicktipp-bot:amd64
Unable to find image 'ghcr.io/antonengelhardt/kicktipp-bot:amd64' locally
amd64: Pulling from antonengelhardt/kicktipp-bot
d25f557d7f31: Pulling fs layer 
420fafe905e6: Pull complete 
655dbd150ead: Pull complete 
cdbfaba2cf0b: Pull complete 
218bfc3b710f: Pull complete 
e1ec0bee04fe: Pull complete 
7eb9c839b2a8: Downloading [==>                                                ]  13.36MB/252.6MB
7eb9c839b2a8: Pull complete 
4864fe4d5b8b: Pull complete 
d789597b21d6: Pull complete 
a06ad60dc2be: Pull complete 
a6256c8db3cd: Pull complete 
2c77f028a598: Pull complete 
c5e890516ee9: Pull complete 
7ddd4957a89f: Pull complete Digest: sha256:31358a354c72759d83f964446352fedf4700e4859cdd69b6eb01353340a0e5ea
Status: Downloaded newer image for ghcr.io/antonengelhardt/kicktipp-bot:amd64
18.06.24 11:04: The script will execute now!

Custom Chrome Driver Path

'str' object has no attribute 'capabilities'

18.06.24 11:04: The script has finished. Sleeping for 1 hour...

Additional Information

I tried building the docker container myself (running ARM), but I got the same error. So it does not seem not architecture related.

tbrodbeck commented 3 months ago

Ok I found the error. The chromedriver path was not valid of the .env.example. I needed to delete it then it it works

antonengelhardt commented 3 months ago

yeah, sorry... ill remove this in my next PR when i work on ARM support

tbrodbeck commented 3 months ago

No worries. Nice bot otherwise :)

antonengelhardt commented 3 months ago

thanks! and open for contributions ;)

im closing this ok?

tbrodbeck commented 3 months ago

I exchanged the business logic a little bit with my own system. I can send you a PR if you are interested after I get it cleaned up

antonengelhardt commented 3 months ago

I exchanged the business logic a little bit with my own system. I can send you a PR if you are interested after I get it cleaned up

Yes, sure 👍🏻

tbrodbeck commented 3 months ago

Hey. I have chosen a quite different approach now.

I have put it in its own repo for now: https://github.com/tbrodbeck/kicktipp-bot-serverless

The main difference between my approach and yours is that this tool is...

  1. it is intended to be run as a job not as a service. So it will stop immediately after checking the games and requires an external scheduling tool such as Cron, GCP Cloud Run Code Triggers or AWS EventBridge.
  2. using PlayWright instead of Selenium. (which is a bit nicer/more modern to use)

Especially, because I used PlayWright - I am not sure how to merge those two repositories anymore.

antonengelhardt commented 2 months ago

Hey. I have chosen a quite different approach now.

I have put it in its own repo for now: https://github.com/tbrodbeck/kicktipp-bot-serverless

The main difference between my approach and yours is that this tool is...

  1. it is intended to be run as a job not as a service. So it will stop immediately after checking the games and requires an external scheduling tool such as Cron, GCP Cloud Run Code Triggers or AWS EventBridge.

I like that idea. We could introduce an environment variable or argument flag (--schedule X) which tells the bot to run itself every X minutes. If not set, the bot will run once and can be scheduled by a CronJob or some other scheduler.

  1. using PlayWright instead of Selenium. (which is a bit nicer/more modern to use)

I do not have much experience with playwright and Selenium works well enough for me. The only annoying this is that i am unable to build an ARM Image with Selenium, because the Chromedriver does not seem to work. Does Playwright work with ARM?

Especially, because I used PlayWright - I am not sure how to merge those two repositories anymore.

Thats totally ok. I can reference your repo in the readme, so people can choose.

tbrodbeck commented 2 months ago

Hi Anton. Sounds good. Would be lovely to be mentioned in the README of this repo :)

And yeah what can I say.. The bot is working fine so far in our little group: 😄

Screenshot 2024-07-08 at 19 08 54
antonengelhardt commented 2 months ago

Hey Tillus,

Awesome man! In the World Cup, i got second two years ago.

I will create a PR now.