This uses Playwright to open Moorepay in a normal browser, wait for you to complete manual login, however you need, including with your hardware key, then iterate the payslip list and download each PDF.
- Node.js 20+
- npm
npm install
npx playwright install chromiumnpm run downloadWhen the browser opens:
- Complete the Moorepay login manually.
- Return to the terminal and press Enter.
- The script will open the payslip list and download each PDF into
downloads/.
- Browser session data is stored in
.pw-user-data/, which helps on reruns. - Downloads are saved as
2026-02-27 payslip.pdf, etc. - If a file already exists with the same generated name, it is skipped.
MOOREPAY_COMPANY_ID=01
MOOREPAY_LIST_URL=https://app.moorepay.co.uk/me/PaydetailsDocuments/index?companyId=01&tabSelection=5§ion=documents#documents
MOOREPAY_LOGIN_URL=...
DOWNLOAD_DIR=downloads
USER_DATA_DIR=.pw-user-data
TIMEOUT_MS=30000