small but infinite error
This commit is contained in:
parent
8d53a2b30b
commit
fbb2feae31
|
@ -4,11 +4,11 @@ ENV DEBIAN_FRONTEND noninteractive
|
||||||
ENV GECKODRIVER_VER v0.31.0
|
ENV GECKODRIVER_VER v0.31.0
|
||||||
ENV FIREFOX_VER 87.0
|
ENV FIREFOX_VER 87.0
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& apt update \
|
&& apt update \
|
||||||
&& apt upgrade -y \
|
&& apt upgrade -y \
|
||||||
&& apt install -y \
|
&& apt install -y \
|
||||||
|
tzdata \
|
||||||
wfrench \
|
wfrench \
|
||||||
git \
|
git \
|
||||||
libx11-xcb1 \
|
libx11-xcb1 \
|
||||||
|
@ -31,6 +31,7 @@ RUN set -x \
|
||||||
&& mv geckodriver /usr/bin/
|
&& mv geckodriver /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
ENV TZ="Europe/Paris"
|
||||||
WORKDIR /app/MsRewards
|
WORKDIR /app/MsRewards
|
||||||
CMD python main.py
|
CMD python main.py
|
||||||
|
|
||||||
|
|
9
V5.py
9
V5.py
|
@ -283,18 +283,23 @@ def spotify():
|
||||||
|
|
||||||
def promo():
|
def promo():
|
||||||
elm = driver.find_element(By.ID, "promo-item")
|
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)
|
driver.execute_script("arguments[0].click();", elm)
|
||||||
custom_sleep(3)
|
custom_sleep(3)
|
||||||
if len(driver.window_handles) > 1 :
|
if len(driver.window_handles) > 1 :
|
||||||
driver.switch_to.window(driver.window_handles[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])
|
close_tab(driver.window_handles[1])
|
||||||
else :
|
else :
|
||||||
try :
|
try :
|
||||||
spotify()
|
spotify()
|
||||||
except :
|
except :
|
||||||
log_error("no new windows", driver)
|
log_error("no new windows", driver)
|
||||||
|
driver.get("https://rewards.bing.com")
|
||||||
custom_sleep(3)
|
custom_sleep(3)
|
||||||
|
|
||||||
# Find out which type of action to do
|
# Find out which type of action to do
|
||||||
|
|
Loading…
Reference in New Issue