small but infinite error

This commit is contained in:
piair 2023-04-14 10:31:12 +02:00
parent 8d53a2b30b
commit fbb2feae31
3 changed files with 10 additions and 4 deletions

View File

@ -4,11 +4,11 @@ ENV DEBIAN_FRONTEND noninteractive
ENV GECKODRIVER_VER v0.31.0
ENV FIREFOX_VER 87.0
WORKDIR /app
RUN set -x \
&& apt update \
&& apt upgrade -y \
&& apt install -y \
tzdata \
wfrench \
git \
libx11-xcb1 \
@ -31,6 +31,7 @@ RUN set -x \
&& mv geckodriver /usr/bin/
ENV TZ="Europe/Paris"
WORKDIR /app/MsRewards
CMD python main.py

9
V5.py
View File

@ -283,18 +283,23 @@ def spotify():
def promo():
elm = driver.find_element(By.ID, "promo-item")
while elm:
for i in range(10):
if not elm:
break
if i > 8 :
log_error("chelou, plus de 8 truc", driver)
driver.execute_script("arguments[0].click();", elm)
custom_sleep(3)
if len(driver.window_handles) > 1 :
driver.switch_to.window(driver.window_handles[len(driver.window_handles)-1])
try_play()
try_play(driver.title)
close_tab(driver.window_handles[1])
else :
try :
spotify()
except :
log_error("no new windows", driver)
driver.get("https://rewards.bing.com")
custom_sleep(3)
# Find out which type of action to do

View File

@ -1 +1 @@
v5.8.1
v5.8.2