{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "6405f0ad-a363-4d36-a808-6f778c7b8c65",
   "metadata": {},
   "source": [
    "## 1. start here, run this cell"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "1a332d6f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ebee0d2271684c0d834cf17cc912376c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Dropdown(description='Select an option:', options=('2024-03-24,Japanese Division 2(日本乙組聯賽),V-Varen Nagasaki(長崎…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import os,sys,json\n",
    "from pprint import pprint\n",
    "import nest_asyncio\n",
    "import asyncio\n",
    "import ipywidgets as widgets\n",
    "\n",
    "from api_footylogic_com.match.statistics.MarketsInfo import getMarketsInfoJson\n",
    "from api_footylogic_com.match.h2h.RecentformInformation import getRecentformInformationJson\n",
    "from api_footylogic_com.tournament.Standings import getStandingsJson\n",
    "from api_footylogic_com.tournament.Competitions import getCompetitionsJson, lookupCompetitionId\n",
    "from api_footylogic_com.match.h2h.Banner import getBannerJson, getTeams, getCompetitionName\n",
    "from api_footylogic_com.match.seasonalstats.DropdownFilters import getDropdownFilters\n",
    "from bet_hkjc_com.football.getJSON import getMatchesJson, getMatchesList\n",
    "\n",
    "from utils.Statistics import getTopBottomWinningAndLoseing\n",
    "from utils.WriteExcel import writeExcel\n",
    "from utils.GetScreenshot import getScreenshot\n",
    "from utils.reports import genExcelReport\n",
    "from utils.getDropdownMenu import genMatchList\n",
    "\n",
    "[options, matches_list] = genMatchList()\n",
    "dropdown = widgets.Dropdown(options=options, description='Select an option:')\n",
    "display(dropdown)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b8309647-791d-4d6b-bb01-4c417c46b13c",
   "metadata": {},
   "source": [
    "## 2. select matches and run below cell"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "98987f47-b2af-4932-9f8d-f0a47dca1c10",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['50019599', '50026115']\n",
      "generate report for 2024-03-23,Spanish Division 2(西班牙乙組聯賽),Alcorcon(艾高干) vs Oviedo(奧維多)\n"
     ]
    }
   ],
   "source": [
    "# generate_report_key = dropdown.value\n",
    "generate_report_key = '2024-03-23,Spanish Division 2(西班牙乙組聯賽),Alcorcon(艾高干) vs Oviedo(奧維多)'\n",
    "\n",
    "report_filename= generate_report_key.replace(',','_').replace(' ','_') +'.xlsx'\n",
    "[tournamentID,matchID] = matches_list[generate_report_key]\n",
    "pprint([tournamentID,matchID])\n",
    "\n",
    "# print('generate report for '+ generate_report_key)\n",
    "print('generate report for '+ generate_report_key)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6a31f956-0ff4-4341-8549-8421da70ab04",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026115/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026115/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50019599/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n"
     ]
    }
   ],
   "source": [
    "genExcelReport(tournamentID, matchID, report_filename)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "772987b4-0d77-4ed0-a396-b0b685608930",
   "metadata": {},
   "source": [
    "## 3. grab the report in _output directory"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3c46d722-0715-4aaf-8b4f-d4163ad88742",
   "metadata": {},
   "source": [
    "### end for phase one"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "4545183e-5e9d-4663-b0a3-08348d56a845",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "05:17:02.595649\n",
      "2024-03-24,Japanese Division 2(日本乙組聯賽),V-Varen Nagasaki(長崎成功丸) vs Ventforet Kofu(甲府風林)\n",
      "working on 0/26 , 2024-03-24,Japanese Division 2(日本乙組聯賽),V-Varen Nagasaki(長崎成功丸) vs Ventforet Kofu(甲府風林)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "2024-03-24,Japanese Division 2(日本乙組聯賽),Vegalta Sendai(仙台維加泰) vs Tokushima Vortis(德島漩渦)\n",
      "working on 1/26 , 2024-03-24,Japanese Division 2(日本乙組聯賽),Vegalta Sendai(仙台維加泰) vs Tokushima Vortis(德島漩渦)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "2024-03-24,Korean FA Cup(南韓足總盃),Jeonnam Dragons(全南天龍) vs Gangneung Citizen(江陵市民)\n",
      "working on 2/26 , 2024-03-24,Korean FA Cup(南韓足總盃),Jeonnam Dragons(全南天龍) vs Gangneung Citizen(江陵市民)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "2024-03-24,Japanese Division 2(日本乙組聯賽),Thespakusatsu Gunma(群馬草津溫泉) vs Fagiano Okayama(岡山綠雉)\n",
      "working on 3/26 , 2024-03-24,Japanese Division 2(日本乙組聯賽),Thespakusatsu Gunma(群馬草津溫泉) vs Fagiano Okayama(岡山綠雉)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "2024-03-24,Spanish Division 2(西班牙乙組聯賽),Amorebieta(阿莫列比達) vs Gijon(希杭)\n",
      "working on 4/26 , 2024-03-24,Spanish Division 2(西班牙乙組聯賽),Amorebieta(阿莫列比達) vs Gijon(希杭)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026117/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026117/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50019599/standings\n",
      "2024-03-24,Spanish Division 2(西班牙乙組聯賽),Huesca(侯爾斯卡) vs Burgos(貝高斯)\n",
      "working on 5/26 , 2024-03-24,Spanish Division 2(西班牙乙組聯賽),Huesca(侯爾斯卡) vs Burgos(貝高斯)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026111/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026111/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50019599/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-24,Spanish Division 2(西班牙乙組聯賽),Valladolid(華拉度列) vs Eibar(伊巴)\n",
      "working on 6/26 , 2024-03-24,Spanish Division 2(西班牙乙組聯賽),Valladolid(華拉度列) vs Eibar(伊巴)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026110/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026110/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50019599/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-25,Spanish Division 2(西班牙乙組聯賽),Levante(利雲特) vs CF Elche(艾爾切)\n",
      "working on 7/26 , 2024-03-25,Spanish Division 2(西班牙乙組聯賽),Levante(利雲特) vs CF Elche(艾爾切)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026116/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026116/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50019599/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-25,Spanish Division 2(西班牙乙組聯賽),Mirandes(米蘭迪斯) vs Zaragoza(薩拉戈薩)\n",
      "working on 8/26 , 2024-03-25,Spanish Division 2(西班牙乙組聯賽),Mirandes(米蘭迪斯) vs Zaragoza(薩拉戈薩)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026119/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026119/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50019599/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-25,International Matches(國際賽),Italy(意大利) vs Ecuador(厄瓜多爾)\n",
      "working on 9/26 , 2024-03-25,International Matches(國際賽),Italy(意大利) vs Ecuador(厄瓜多爾)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "2024-03-25,Spanish Division 2(西班牙乙組聯賽),Santander(桑坦德) vs CD Eldense(CD艾丹斯)\n",
      "working on 10/26 , 2024-03-25,Spanish Division 2(西班牙乙組聯賽),Santander(桑坦德) vs CD Eldense(CD艾丹斯)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026112/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026112/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50019599/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-25,International Matches(國際賽),Jamaica(牙買加) vs Panama(巴拿馬)\n",
      "working on 11/26 , 2024-03-25,International Matches(國際賽),Jamaica(牙買加) vs Panama(巴拿馬)\n",
      "Banner.py: get banner json done\n",
      "2024-03-25,International Matches(國際賽),Guatemala(危地馬拉) vs Venezuela(委內瑞拉)\n",
      "working on 12/26 , 2024-03-25,International Matches(國際賽),Guatemala(危地馬拉) vs Venezuela(委內瑞拉)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "2024-03-25,International Matches(國際賽),USA(美國) vs Mexico(墨西哥)\n",
      "working on 13/26 , 2024-03-25,International Matches(國際賽),USA(美國) vs Mexico(墨西哥)\n",
      "Banner.py: get banner json done\n",
      "2024-03-26,Spanish Division 2(西班牙乙組聯賽),Albacete(阿爾巴塞特) vs Racing de Ferrol(費路爾競賽)\n",
      "working on 14/26 , 2024-03-26,Spanish Division 2(西班牙乙組聯賽),Albacete(阿爾巴塞特) vs Racing de Ferrol(費路爾競賽)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026118/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50019599/50026118/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50019599/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-26,Chilean Division 1(智利甲組聯賽),Universidad Chile(智利大學) vs Cobresal(科布雷素)\n",
      "working on 15/26 , 2024-03-26,Chilean Division 1(智利甲組聯賽),Universidad Chile(智利大學) vs Cobresal(科布雷素)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "2024-03-30,Eng Premier(英格蘭超級聯賽),Newcastle(紐卡素) vs West Ham(韋斯咸)\n",
      "working on 16/26 , 2024-03-30,Eng Premier(英格蘭超級聯賽),Newcastle(紐卡素) vs West Ham(韋斯咸)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025367/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025367/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "2024-03-30,Eng Premier(英格蘭超級聯賽),Chelsea(車路士) vs Burnley(般尼)\n",
      "working on 17/26 , 2024-03-30,Eng Premier(英格蘭超級聯賽),Chelsea(車路士) vs Burnley(般尼)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026779/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026779/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "2024-03-30,Eng Premier(英格蘭超級聯賽),Tottenham(熱刺) vs Luton(盧頓)\n",
      "working on 18/26 , 2024-03-30,Eng Premier(英格蘭超級聯賽),Tottenham(熱刺) vs Luton(盧頓)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026607/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026607/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-30,Eng Premier(英格蘭超級聯賽),Bournemouth(般尼茅夫) vs Everton(愛華頓)\n",
      "working on 19/26 , 2024-03-30,Eng Premier(英格蘭超級聯賽),Bournemouth(般尼茅夫) vs Everton(愛華頓)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026614/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026614/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-30,Eng Premier(英格蘭超級聯賽),Nottingham Forest(諾定咸森林) vs Crystal Palace(水晶宮)\n",
      "working on 20/26 , 2024-03-30,Eng Premier(英格蘭超級聯賽),Nottingham Forest(諾定咸森林) vs Crystal Palace(水晶宮)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026778/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026778/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-30,Eng Premier(英格蘭超級聯賽),Sheff Utd(錫菲聯) vs Fulham(富咸)\n",
      "working on 21/26 , 2024-03-30,Eng Premier(英格蘭超級聯賽),Sheff Utd(錫菲聯) vs Fulham(富咸)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026613/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50026613/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-31,Eng Premier(英格蘭超級聯賽),Aston Villa(阿士東維拉) vs Wolves(狼隊)\n",
      "working on 22/26 , 2024-03-31,Eng Premier(英格蘭超級聯賽),Aston Villa(阿士東維拉) vs Wolves(狼隊)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025366/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025366/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-31,Eng Premier(英格蘭超級聯賽),Brentford(賓福特) vs Manchester Utd(曼聯)\n",
      "working on 23/26 , 2024-03-31,Eng Premier(英格蘭超級聯賽),Brentford(賓福特) vs Manchester Utd(曼聯)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025368/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025368/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "2024-03-31,Eng Premier(英格蘭超級聯賽),Liverpool(利物浦) vs Brighton(白禮頓)\n",
      "working on 24/26 , 2024-03-31,Eng Premier(英格蘭超級聯賽),Liverpool(利物浦) vs Brighton(白禮頓)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025370/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025370/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "IndexError('list index out of range')\n",
      "'error:{jp:statistics.distilledRecent8Results.homeTeam[4].pos}'\n",
      "IndexError('list index out of range')\n",
      "'error:{jp:statistics.distilledRecent8Results.homeTeam[4].fullTimeScore}'\n",
      "IndexError('list index out of range')\n",
      "'error:{jp:statistics.distilledRecent8Results.awayTeam[4].pos}'\n",
      "IndexError('list index out of range')\n",
      "'error:{jp:statistics.distilledRecent8Results.awayTeam[4].fullTimeScore}'\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "2024-03-31,Eng Premier(英格蘭超級聯賽),Manchester City(曼城) vs Arsenal(阿仙奴)\n",
      "working on 25/26 , 2024-03-31,Eng Premier(英格蘭超級聯賽),Manchester City(曼城) vs Arsenal(阿仙奴)\n",
      "Banner.py: get banner json done\n",
      "MarketsInfo.py: getMarketsInfoJson done\n",
      "DropdownFilters.py: get getDropdownFilters json done\n",
      "Options.py: get options done\n",
      "Standings.py: get standings done\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025369/bmstatistics\n",
      "https://footylogic.com/en/matchcenter/0/50015668/50025369/bmrecentforms\n",
      "https://footylogic.com/en/tournament/league/50015668/standings\n",
      "/app/notebook/_images/bmstatistics.png\n",
      "/app/notebook/_images/bmrecentforms.png\n",
      "/app/notebook/_images/standings.png\n",
      "reports.py: done...\n",
      "05:19:52.123568\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "print(datetime.now().time())\n",
    "\n",
    "target_date = '2024-03'\n",
    "\n",
    "for i in range(0, len(options)):\n",
    "    try:\n",
    "        option = options[i]\n",
    "        print(option)\n",
    "        if (option.index(target_date) > -1):\n",
    "            print('working on '+str(i)+'/'+str(len(options))+' , '+option)\n",
    "            [tournamentID,matchID] = matches_list[option]\n",
    "            report_filename= option.replace(',','_').replace(' ','_') +'.xlsx'\n",
    "            genExcelReport(tournamentID, matchID, report_filename)\n",
    "    except Exception as e:\n",
    "        pass\n",
    "\n",
    "print(datetime.now().time())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8e1bb1c6-6b4b-4c4b-ad93-5192fdd7faf0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
