McDonald's allows its franchisees some leeway in menu pricing, hence there may be a slight variation in in-store prices across different franchise locations in the same country. Such prices are not widely accessible online.
Price figures recorded here are from each territory's online McDelivery menu, which is consistent within said country / territory.
Vendor Page
points to the official McDelivery order webpage, or, if it is not accessible by script, to an assigned delivery partner.
Scraper Script
is a direct link to the .py script that is executed by the workflow to scrape menu data.
Scraped Files
links to the folder holding the scraped data in csv file format.
Workflow File
is a direct link to the auto scraper file that is automatically triggered by a cron schedule.
Delivery fees are not included. Surcharges for drink changes and menu upsizes are also not included. Vouchers, in-store and in-app promotions are not included, unless explicitly itemised in the vendor's webpage scraped by the script.
For ease of comparison, all prices are recorded in both local currency and USD.
The exchange rate is fetched live from Xe.com just prior to scraping McDelivery menu data. This rate is the mid-market rate, not the send rate. Please do not rely on it to make purchases.
.
├── .github/workflows/
│ ├── Auto scraper workflow files
│ └── Maintenance workflow files
├── Territory folders: mcd-<library>-<ccTLD>/
│ ├── Scraper Script
│ └── scraped-data/
│ └── Scraped Files
├── default-schedule.csv
└── .py Maintenance scripts
Except the workflow files, each territory has its associated files sequestered in its own folder. There are no shared user modules. Each territory, as a separate entity, has its code developed individually.
The territory folder and its associated files follow a common naming convention:
mcd-<library>-<ccTLD>
Scraped data files are housed in a scraped-data
folder within the territory folder. Each file is prefixed with an additional timestamp
[yyyy-mm-dd hh:mm:ss]
in Local Date and Time.
mcd prefix : scraping McDonald's data.
library : main library or framework used to scrape webpage data. Click for details.
bs4
: Beautiful Soup 4req
: Requestsscr
: Scrapysel
: Selenium WebDriver
ccTLD suffix : country code top-level domain of each APAC territory. Click for details.
au
: Australiabn
: Bruneifj
: Fijihk
: Hong Kongin
: Indiaid
: Indonesiajp
: Japankr
: South Koreamy
: Malaysianz
: New Zealandpk
: Pakistanph
: Philippinessg
: Singaporelk
: Sri Lankatw
: Taiwanth
: Thailandvn
: Vietnam
File tree with associated files for Singapore.
.
├── .github/workflows/
│ └── scrape-sg-auto.yml
└── mcd-bs4-sg/
├── mcd-bs4-sg.py
└── scraped-data/
├── [2022-08-15 03:30:57] mcd-bs4-sg.csv
└── [2022-08-16 03:31:12] mcd-bs4-sg.csv
2. Workflows and Maintenance Scripts
flowchart LR
A([scrape-territory-auto.yml])-->B[[Run mcd-library-territory.py]]
B ==>|output|G[("[timestamp] mcd-library-territory.csv")]
B -.->|trigger on run|C([inspector.yml])
C -->D{{Scraping Successful?}} ==>|Yes| E[[Run reset-schedule.py]]
D ==>|No| F[[Run reschedule-next-run.py]]
E -->|next run back at usual time tomorrow| A
F -->|next run in one hour| A
Automated scraper files, one for each territory, execute its scraper script in a GitHub hosted virtual machine.
They are triggered on cron schedules defined in default-schedule.csv
.
inspector.yml : runs after every scraper workflow finishes running to execute scripts depending on the result of the scraper workflow. Click for description of each script.
These scripts edit the cron values in workflow .yml files.
-
reschedule-next-run.py
: executes on failure of scraper workflow, ensures scrape reattempt by rescheduling the next run to be one hour from the last scheduled run. -
reset-schedule.py
: executes on success of scraper workflow, resets the schedule back to the original cron value defined indefault-schedule.csv
.
flowchart LR
F([update-utcoffset.yml]) -->G[[Run update-utcoffset.py]] -->|Check and update UTC Time, Offset, and Cron|H[(default-schedule.csv)]
I(User makes changes to default-schedule.csv) --> F
J(Cron schedule trigger) --> F
update-utcoffset.yml : maintains data accuracy in default-schedule.csv. Triggered on schedule once a day, and when default-schedule.csv is edited. Executes update-utcoffset.py to ensure UTC offset values are current (for Daylight Savings), and UTC Time values (and Cron values) are corrected after user edits are made to Local Time values.
Use of these scripts is limited only to non-sensitive and publicly available data.
The automated scripts wholly rely on virtual machines hosted by GitHub Actions to execute them. While every effort has been made to ensure timely execution, there have been instances of temporary disruption to GitHub services. Scheduled events are often delayed, more so especially during periods of high loads of GitHub Action workflow runs.
The material embodied in this repository is provided to you "as-is" and without warranty of any kind, express, implied or otherwise, including without limitation, any warranty of fitness for a particular purpose. In no event shall the author be liable to you or anyone else for any direct, special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, including without limitation, loss of profit, loss of use, savings or revenue, or the claims of third parties, whether or not the author has been advised of the possibility of such loss, however caused and on any theory of liability, arising out of or in connection with the possession, use or performance of this repository.