├── .gitignore ├── README.md └── PassportAppointmentsFinder.ipynb /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IsraelPassportBooking 2 | ```diff 3 | - The API request that required to work on this implementation has been removed from the server, breaking this script. 4 | - https://central.qnomy.com/CentralAPI/GetServiceTypeList?organizationId=56 5 | - There are other developers providing the same functionality. This comment will be updated when I get to update my scripts . 6 | 7 | ``` 8 | 9 | 10 | A tool that allows users to choose a Ministry of the Interior Office to make a booking without a long waiting time 11 | 12 | 13 | # Background 14 | I discovered early in 2022 that one of my daughter's Israeli passport had expired. I wanted to renew it quickly, and at the time the only option to secure a reservation was on the [web application](https://myvisit.com/#!/home/signin/). I logged in with her details and selected our local office and discovered an unacceptable waiting time. 15 | 16 | After returning to the earlier page- I discovered that the flow was really bad. 17 | The first login required a two-factor authentication (Teudat Zehut / ID Number) and mobile phone number. 18 | I needed to log in each time I wanted to select a new office, each time requiring the entry of the same ID number (Teudat Zehut) and phone number from before. 19 | This flow was really frustrating and about 5 sites I decided to automate the process. 20 | 21 | # Reverse engineering the booking application (Notes from after building the script. Verify and update) 22 | The Engish language goverment site [Schedule an appointment to issue biometric documents](https://www.gov.il/en/Departments/news/schedule_appointment_for_biometric_docs) links to the web application to book an appointment [web application](https://myvisit.com/#!/home/signin/). 23 | 24 | * The logging into the web application requires the creation of an account with phone number and a Capcha. A text message with a one-time password is sent, and you need to enter the one-time code 25 | 26 | * Note- there is an option to use the login procedure where you don't perform 2FA, and you don't have the ability to change bookings. 27 | 28 | A provider is selected and a location is selected. The service is selected. Enter ID Number. Enter Phone Number. Choose the service Darcon Biometri / biometric passport. 29 | 30 | You then receive a list of Available Dates that show the Available times when you click on them. 31 | 32 | # Initial Automation Solution 33 | In the browser manually perform the first login and find your way the Available Date picker for one location. This should set up some browser authentication 34 | 35 | (Google Chrome) Right click and press 'inspect' which should bring up the source and a few other options. Reload a date while observing the network traffic. Copy out the authorization from the "request headers" and save it in a text editor. 36 | To retrive the authentication token required for using the script to pull bookings, right click on the browser window and select "inspect". From here find the button that opens a Javascript console. 37 | Type this into the console `sessionStorage['user.session-token']` and you should get a long string (634 in my case). 38 | Copy this string and save it for later. 39 | 40 | 41 | Open up the [juypter notebook PassportAppointmentsFinder.ipynb](https://github.com/frankbolton/IsraelPassportBooking/blob/main/PassportAppointmentsFinder.ipynb) and paste in the token `paste_token="replace with token"`, your phone number and teudat zehut and run all the cells. 42 | Optionally, update your home coordinates to sort by nearest office first. 43 | A table will print the next 10 days for each office, where appointments exist and how many appoinments exist. 44 | 45 | Return to the web application and browse to the date of interest and make a booking. 46 | 47 | -------------------------------------------------------------------------------- /PassportAppointmentsFinder.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "134a715e", 6 | "metadata": {}, 7 | "source": [ 8 | "Automated script for trying to find the earliest appointments\n", 9 | "Israel's ministry of the interior is using a web-first way to book appoinments This might be convenient- but at present the web application used has a problematic flow.\n", 10 | "\n", 11 | "You need to enter an ID number and a phone number each time you want to change the location You then need to also instruct the system that you want to use the passport option.\n", 12 | "\n", 13 | "The goal of this notebook is to automate the API calls and present a list of the locations + date for places with the earliest available appointments.\n", 14 | "\n", 15 | "Current web application flow\n", 16 | "(I don't plan to automate the first few calls)\n", 17 | "\n", 18 | "Create an account on the myvisit.com website using a mobile phone number and click on a captcha\n", 19 | "Enter the one time pin from the text message\n", 20 | "Select the provider . . . (These are the steps I want to automate. )" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 4, 26 | "id": "f8db5b39", 27 | "metadata": {}, 28 | "outputs": [ 29 | { 30 | "name": "stdout", 31 | "output_type": "stream", 32 | "text": [ 33 | "JWT 13224\n" 34 | ] 35 | } 36 | ], 37 | "source": [ 38 | "import requests\n", 39 | "import os\n", 40 | "\n", 41 | "#to sort results- center on the coordinates of the Petah Tikva Ministry of the Interior\n", 42 | "lat = '32.0934236'\n", 43 | "lon = '34.8649893'\n", 44 | "\n", 45 | "#Paste in the token taken from the browser after logging into the myvisit page\n", 46 | "paste_token=\"replace with token\"\n", 47 | "\n", 48 | "\n", 49 | "#Workaround for development without leaning credentials\n", 50 | "try:\n", 51 | " auth = os.environ.get('Passport_token')\n", 52 | "except:\n", 53 | " auth = \"JWT \" + paste_token\n", 54 | " \n", 55 | "print(auth)" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": 2, 61 | "id": "2b22a707", 62 | "metadata": {}, 63 | "outputs": [ 64 | { 65 | "name": "stdout", 66 | "output_type": "stream", 67 | "text": [ 68 | "{'Success': True, 'Results': [{'serviceTypeId': 156, 'serviceTypeName': 'תיאום פגישה לתיעוד ביומטרי', 'description': 'בכל פניה יינתן שירות לפונה/אדם אחד בלבד\\nהנפקת דרכונים ות.ז. ביומטרים,\\nשינוי מצב אישי,\\nשינוי שם,\\nהצהרה על תאריך לידה (יום וחודש).', 'IconPath': 'servicetypecustom/2f935c2c-47ca-401e-88af-4c0e74969d6f.png', 'availableLocationCount': 49, 'locationId': 0, 'ExtRef': '', 'Tags': ''}], 'Page': 0, 'ResultsPerPage': 0, 'TotalResults': 1, 'ErrorMessage': None, 'ErrorNumber': 0, 'Messages': None}\n", 69 | "156\n" 70 | ] 71 | } 72 | ], 73 | "source": [ 74 | "#Parameters needed to complete the flow and auth\n", 75 | "#OrganizationId = 56 - fixed for all passport offices LocationId - dependent on what location / office\n", 76 | "\n", 77 | "url_get_service_type = 'https://central.qnomy.com/CentralAPI/GetServiceTypeList?organizationId=56'\n", 78 | "r = requests.get(url_get_service_type).json()\n", 79 | "print(r)\n", 80 | "serviceTypeId = r['Results'][0]['serviceTypeId']\n", 81 | "print(serviceTypeId)" 82 | ] 83 | }, 84 | { 85 | "cell_type": "code", 86 | "execution_count": 5, 87 | "id": "cca95f49", 88 | "metadata": {}, 89 | "outputs": [ 90 | { 91 | "name": "stdout", 92 | "output_type": "stream", 93 | "text": [ 94 | "[809, 826, 799, 828, 802, 871, 807, 827, 821, 869, 818, 979, 819, 899, 817, 1038, 816, 1071, 859, 854, 1019, 870, 822, 1599, 825, 893, 855, 1073, 2265, 1037, 858, 849, 841, 856, 978, 861, 852, 842, 889, 860, 1822, 868, 853, 951, 866, 843, 1327, 867, 872]\n", 95 | "['לשכת פתח תקוה', 'לשכת בני ברק', 'לשכת רמת גן-גבעתיים', 'לשכת ראש העין', 'לשכת תל אביב מרכז (קריית הממשלה)', 'לשכת הרצליה', 'לשכת כפר סבא', 'לשכת ת\"א דרום (יפו)', 'לשכת חולון', 'לשכת ראשון לציון', 'לשכת רמלה', 'לשכת טייבה', 'לשכת רחובות', 'לשכת מודיעין עילית', 'לשכת נתניה', 'לשכת אריאל', 'לשכת חדרה', 'לשכת שדרות', 'לשכת בית שמש', 'לשכת אשדוד', 'לשכת קלנדיה قلنديا', 'לשכת מזרח ירושלים شرق القدس', 'לשכת ירושלים', 'לשכת צור באהר صور باهر', 'לשכת ירושלים דרום-הר חומה', 'לשכת מעלה אדומים ', 'לשכת אשקלון', 'לשכת קרית גת', 'לשכת אום אל פחם', 'לשכת יקנעם', 'לשכת עפולה', 'לשכת רהט', 'לשכת נתיבות', 'לשכת חיפה', 'לשכת קריות (קניון שער הצפון)', ' לשכת נוף הגליל (נצרת עילית)', 'לשכת עכו', 'לשכת באר שבע', \"לשכת סח'נין\", 'לשכת טבריה', 'לשכת דיר אל אסד', 'לשכת כרמיאל', 'לשכת נהריה ', 'לשכת מעלות תרשיחא', 'לשכת צפת', 'לשכת דימונה', 'לשכת קצרין', 'לשכת קרית שמונה', 'לשכת אילת']\n", 96 | "[2113, 2163, 2095, 2167, 2099, 2245, 2110, 2165, 2153, 2241, 2148, 2749, 2150, 2349, 2146, 2991, 2144, 3078, 2225, 2215, 2882, 2243, 2155, 5550, 2161, 2297, 2217, 3086, 8977, 2989, 2223, 2205, 2194, 2219, 2744, 2229, 2211, 2196, 2285, 2227, 5901, 2239, 2213, 2654, 2235, 2198, 4706, 2237, 2247]\n" 97 | ] 98 | } 99 | ], 100 | "source": [ 101 | "#get the list of locations\n", 102 | "\n", 103 | "LocationId_list = []\n", 104 | "LocationName_list= []\n", 105 | "ServiceName_list= []\n", 106 | " \n", 107 | "\n", 108 | "#url_get_locations = 'https://central.qnomy.com/CentralAPI/LocationSearch?currentPage=1&isFavorite=false&orderBy=Distance&organizationId=56&position=%7B%22lat%22:%2232.7882%22,%22lng%22:%2234.9595%22,%22accuracy%22:1440%7D&resultsInPage=100&serviceTypeId=156&src=mvws'\n", 109 | "url_get_locations = f'https://central.qnomy.com/CentralAPI/LocationSearch?currentPage=1&isFavorite=false&orderBy=Distance&organizationId=56&position=%7B%22lat%22:%22{lat}%22,%22lng%22:%22{lon}%22,%22accuracy%22:1440%7D&resultsInPage=100&serviceTypeId=156&src=mvws'\n", 110 | "\n", 111 | "r_locations = requests.get(url_get_locations).json()\n", 112 | "# print(r_locations['Results'][0:3])\n", 113 | "\n", 114 | "r2= requests.get(url_get_locations).json()\n", 115 | "for a in r2['Results']:\n", 116 | " LocationId_list.append(a['LocationId'])\n", 117 | " LocationName_list.append(a['LocationName'])\n", 118 | " ServiceName_list.append(a['ServiceId'])\n", 119 | " \n", 120 | " #print(a['LocationName']+' '+ str(a['LocationId'])) + \" \" + str(a['ServiceId'])\n", 121 | "print(LocationId_list)\n", 122 | "print(LocationName_list)\n", 123 | "print(ServiceName_list)\n" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": 6, 129 | "id": "d4136e3a", 130 | "metadata": {}, 131 | "outputs": [], 132 | "source": [ 133 | "dates = []\n", 134 | "times = []\n", 135 | "\n", 136 | "def get_nearest_booking(e_index):\n", 137 | " location_id = LocationId_list[e_index]\n", 138 | " location_service_code = ServiceName_list[e_index]\n", 139 | " location_name = LocationName_list[e_index]\n", 140 | " print(f\"the location {location_name} - id is {location_id} and the service code is {location_service_code}\")\n", 141 | " #get the dates\n", 142 | " url_get_dates =f\"https://central.qnomy.com/CentralAPI/SearchAvailableDates?maxResults=10&serviceId={location_service_code}&startDate=2022-01-23\"\n", 143 | "\n", 144 | " print(requests.get(url_get_dates, headers={'Authorization': auth}))\n", 145 | " r3 = requests.get(url_get_dates, headers={'Authorization': auth}).json()\n", 146 | " #if (len(r3['Results'])>0):\n", 147 | " try:\n", 148 | " for date in r3['Results']:\n", 149 | " date_code = date['calendarId']\n", 150 | " date_string = date['calendarDate']\n", 151 | " print(date_string)\n", 152 | " url_get_slots = f'https://central.qnomy.com/CentralAPI/SearchAvailableSlots?CalendarId={date_code}&ServiceId={location_service_code}'\n", 153 | "\n", 154 | " r4 = requests.get(url_get_slots, headers={'Authorization': auth}).json()\n", 155 | " try:\n", 156 | " print(r4['Results'])\n", 157 | " # try:\n", 158 | " except:\n", 159 | " print(\".\")\n", 160 | " except:\n", 161 | " print(\"..\")" 162 | ] 163 | }, 164 | { 165 | "cell_type": "code", 166 | "execution_count": null, 167 | "id": "7591618d", 168 | "metadata": {}, 169 | "outputs": [], 170 | "source": [ 171 | "for index in range(len(LocationName_list)):\n", 172 | "# print(index)\n", 173 | " temp = get_nearest_booking(index)\n" 174 | ] 175 | }, 176 | { 177 | "cell_type": "code", 178 | "execution_count": 9, 179 | "id": "11038c44", 180 | "metadata": {}, 181 | "outputs": [ 182 | { 183 | "name": "stdout", 184 | "output_type": "stream", 185 | "text": [ 186 | "the location לשכת פתח תקוה - id is 809 and the service code is 2113\n", 187 | "\n", 188 | "2022-03-22T00:00:00\n", 189 | "[]\n", 190 | "2022-03-23T00:00:00\n", 191 | "[]\n", 192 | "2022-05-30T00:00:00\n", 193 | "[{'Time': 576}]\n", 194 | "2022-07-03T00:00:00\n", 195 | "[{'Time': 744}]\n", 196 | "2022-07-04T00:00:00\n", 197 | "[{'Time': 612}]\n", 198 | "2022-07-05T00:00:00\n", 199 | "[{'Time': 624}]\n", 200 | "2022-07-07T00:00:00\n", 201 | "[{'Time': 564}, {'Time': 588}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 202 | "2022-07-10T00:00:00\n", 203 | "[{'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 204 | "2022-07-11T00:00:00\n", 205 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}, {'Time': 870}, {'Time': 882}, {'Time': 894}, {'Time': 906}, {'Time': 918}, {'Time': 930}, {'Time': 942}, {'Time': 954}, {'Time': 966}, {'Time': 978}, {'Time': 990}, {'Time': 1002}, {'Time': 1014}]\n", 206 | "2022-07-12T00:00:00\n", 207 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}, {'Time': 900}, {'Time': 910}, {'Time': 920}, {'Time': 930}, {'Time': 940}, {'Time': 950}, {'Time': 960}, {'Time': 970}, {'Time': 980}, {'Time': 990}, {'Time': 1000}, {'Time': 1010}, {'Time': 1020}, {'Time': 1030}, {'Time': 1040}]\n", 208 | "the location לשכת בני ברק - id is 826 and the service code is 2163\n", 209 | "\n", 210 | "2022-03-23T00:00:00\n", 211 | "[]\n", 212 | "2022-04-11T00:00:00\n", 213 | "[]\n", 214 | "2022-05-11T00:00:00\n", 215 | "[]\n", 216 | "2022-06-30T00:00:00\n", 217 | "[{'Time': 636}, {'Time': 648}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}]\n", 218 | "2022-07-03T00:00:00\n", 219 | "[{'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 220 | "2022-07-04T00:00:00\n", 221 | "[{'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 870}, {'Time': 882}, {'Time': 894}, {'Time': 906}, {'Time': 918}, {'Time': 930}, {'Time': 942}, {'Time': 954}, {'Time': 966}, {'Time': 978}, {'Time': 990}, {'Time': 1002}]\n", 222 | "2022-07-05T00:00:00\n", 223 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 224 | "2022-07-06T00:00:00\n", 225 | "[{'Time': 870}, {'Time': 882}, {'Time': 894}, {'Time': 906}, {'Time': 918}, {'Time': 930}, {'Time': 942}, {'Time': 954}, {'Time': 966}, {'Time': 978}, {'Time': 990}]\n", 226 | "2022-07-07T00:00:00\n", 227 | "[{'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 228 | "2022-07-10T00:00:00\n", 229 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 230 | "the location לשכת רמת גן-גבעתיים - id is 799 and the service code is 2095\n", 231 | "\n", 232 | "2022-03-24T00:00:00\n", 233 | "[]\n", 234 | "2022-04-25T00:00:00\n", 235 | "[]\n", 236 | "2022-05-02T00:00:00\n", 237 | "[]\n", 238 | "2022-05-09T00:00:00\n", 239 | "[]\n", 240 | "2022-05-16T00:00:00\n", 241 | "[]\n", 242 | "2022-05-23T00:00:00\n", 243 | "[]\n", 244 | "2022-05-30T00:00:00\n", 245 | "[]\n", 246 | "2022-06-01T00:00:00\n", 247 | "[]\n", 248 | "2022-06-15T00:00:00\n", 249 | "[]\n", 250 | "2022-06-22T00:00:00\n", 251 | "[]\n", 252 | "the location לשכת ראש העין - id is 828 and the service code is 2167\n", 253 | "\n", 254 | "2022-03-22T00:00:00\n", 255 | "[]\n", 256 | "2022-03-23T00:00:00\n", 257 | "[]\n", 258 | "2022-07-12T00:00:00\n", 259 | "[{'Time': 768}]\n", 260 | "2022-07-14T00:00:00\n", 261 | "[{'Time': 552}, {'Time': 588}, {'Time': 612}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 744}]\n", 262 | "2022-07-17T00:00:00\n", 263 | "[{'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 264 | "2022-07-18T00:00:00\n", 265 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}, {'Time': 870}, {'Time': 882}, {'Time': 894}, {'Time': 906}, {'Time': 918}, {'Time': 930}, {'Time': 942}, {'Time': 954}, {'Time': 966}, {'Time': 978}]\n", 266 | "2022-07-19T00:00:00\n", 267 | "[{'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 268 | "2022-07-20T00:00:00\n", 269 | "[{'Time': 882}, {'Time': 894}, {'Time': 906}, {'Time': 930}, {'Time': 942}, {'Time': 954}, {'Time': 966}, {'Time': 978}]\n", 270 | "2022-07-21T00:00:00\n", 271 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 272 | "the location לשכת תל אביב מרכז (קריית הממשלה) - id is 802 and the service code is 2099\n", 273 | "\n", 274 | "2022-03-22T00:00:00\n", 275 | "[]\n", 276 | "2022-03-23T00:00:00\n", 277 | "[]\n", 278 | "2022-07-05T00:00:00\n", 279 | "[{'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 280 | "2022-07-06T00:00:00\n", 281 | "[{'Time': 882}, {'Time': 894}, {'Time': 906}, {'Time': 918}, {'Time': 930}, {'Time': 942}, {'Time': 954}, {'Time': 966}, {'Time': 978}]\n", 282 | "2022-07-07T00:00:00\n", 283 | "[{'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 284 | "2022-07-10T00:00:00\n", 285 | "[{'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}]\n", 286 | "2022-07-11T00:00:00\n" 287 | ] 288 | }, 289 | { 290 | "name": "stdout", 291 | "output_type": "stream", 292 | "text": [ 293 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}, {'Time': 870}, {'Time': 882}, {'Time': 894}, {'Time': 906}, {'Time': 918}, {'Time': 930}, {'Time': 942}, {'Time': 954}, {'Time': 966}, {'Time': 978}, {'Time': 990}]\n", 294 | "2022-07-12T00:00:00\n", 295 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n", 296 | "2022-07-13T00:00:00\n", 297 | "[{'Time': 870}, {'Time': 882}, {'Time': 894}, {'Time': 906}, {'Time': 918}, {'Time': 930}, {'Time': 942}, {'Time': 954}, {'Time': 966}, {'Time': 978}, {'Time': 990}, {'Time': 1002}]\n", 298 | "2022-07-14T00:00:00\n", 299 | "[{'Time': 480}, {'Time': 492}, {'Time': 504}, {'Time': 516}, {'Time': 528}, {'Time': 540}, {'Time': 552}, {'Time': 564}, {'Time': 576}, {'Time': 588}, {'Time': 600}, {'Time': 612}, {'Time': 624}, {'Time': 636}, {'Time': 648}, {'Time': 660}, {'Time': 672}, {'Time': 684}, {'Time': 696}, {'Time': 708}, {'Time': 720}, {'Time': 732}, {'Time': 744}, {'Time': 756}, {'Time': 768}]\n" 300 | ] 301 | } 302 | ], 303 | "source": [ 304 | "for index in range(len(LocationName_list[:5])):\n", 305 | "# print(index)\n", 306 | " temp = get_nearest_booking(index)\n" 307 | ] 308 | }, 309 | { 310 | "cell_type": "code", 311 | "execution_count": null, 312 | "id": "92ca4e67", 313 | "metadata": {}, 314 | "outputs": [], 315 | "source": [] 316 | } 317 | ], 318 | "metadata": { 319 | "kernelspec": { 320 | "display_name": "Python 3 (ipykernel)", 321 | "language": "python", 322 | "name": "python3" 323 | }, 324 | "language_info": { 325 | "codemirror_mode": { 326 | "name": "ipython", 327 | "version": 3 328 | }, 329 | "file_extension": ".py", 330 | "mimetype": "text/x-python", 331 | "name": "python", 332 | "nbconvert_exporter": "python", 333 | "pygments_lexer": "ipython3", 334 | "version": "3.7.11" 335 | } 336 | }, 337 | "nbformat": 4, 338 | "nbformat_minor": 5 339 | } 340 | --------------------------------------------------------------------------------