From 12160ca37b3eb13c59686da2ece4b23554ac0ce2 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 31 May 2023 14:46:04 +0900 Subject: [PATCH] =?UTF-8?q?=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0=E3=81=8Cst?= =?UTF-8?q?r=E3=81=A7=E5=8F=96=E5=BE=97=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=81=A7int()=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index bb21f3c..6c65792 100644 --- a/app/main.py +++ b/app/main.py @@ -11,8 +11,8 @@ import time,os profile_dir = "/tmp/profile" username = os.environ["RAKUTENID"] password = os.environ["RAKUTENPW"] -rch_time = os.environ["RCH_WATCH_TIME"] -rch_num = os.environ["RCH_WATCH_NUM"] +rch_time = int(os.environ["RCH_WATCH_TIME"]) +rch_num = int(os.environ["RCH_WATCH_NUM"]) target_url = "https://channel.rakuten.co.jp/" welcome_btn_css = 'button[data-ratid="welcome_pg1_ok"]' login_btn_css = 'button[data-ratid="login_button"]' @@ -104,7 +104,8 @@ def watching_rch(): # 10秒待機 time.sleep(10) - for i in range(0,rch_num): + for i in range(0, rch_num): + print( str( i + 1) + "番目のチャンネルの視聴を始めます。視聴時間は" + str(rch_time) + "秒に設定されています。") channel_btns = driver.find_elements(By.CSS_SELECTOR, channel_btn_css) channel_btn = channel_btns[i] channel_btn.click() @@ -120,5 +121,5 @@ def main(): watching_rch() if __name__ == '__main__': - time.sleep(120) # selniumコンテナの起動を待つ待機 + time.sleep(60) # selniumコンテナの起動を待つ待機 main() \ No newline at end of file