This project logs in with Playwright, keeps a persistent Chromium profile, and leaves the browser on the logged-in page for internal automation tests and observation.
By default it does not bypass slider/captcha verification. For unattended relogin, prefer a server-side automation whitelist or internal login endpoint for the automation account. In an approved test environment, it can optionally run a configurable slider drag action after the login form is submitted.
npm install
cp .env.example .envEdit .env:
EPTRADE_USERNAMEEPTRADE_PASSWORD- optional
EPTRADE_KEEP_BROWSER_OPEN=1
Optional slider automation settings for test environments:
EPTRADE_SLIDER_AUTOMATION=1EPTRADE_SLIDER_DISTANCE=180EPTRADE_SLIDER_HANDLE_SELECTOR=.slider-buttonEPTRADE_SLIDER_TRACK_SELECTOR=.slider-track
For the current Tianai slider, the script opens the verification panel, detects the puzzle target from the generated images, drags the slider, waits for 验证成功, and then submits the login form. If EPTRADE_SLIDER_DISTANCE is set, that fixed distance overrides image detection.
npm startThe script:
- Opens
https://www.eptrade.cn/ui-oss-portal/dashboard. - Reuses
.auth/eptrade-profileif it is already logged in. - Otherwise fills the login form.
- Fails clearly if a slider challenge appears, unless
EPTRADE_SLIDER_AUTOMATION=1is enabled. - Leaves the browser on the logged-in redirected page.
- Keeps the browser open by default so the page can be observed.
Set EPTRADE_DEBUG_NETWORK=1 to print login and captcha network diagnostics.