drissionpage-dev

Installation
SKILL.md

DrissionPage Dev

Overview

Use this skill to build reliable DrissionPage automation in Python by following a consistent workflow and consulting the bundled official docs in references/docs/.

Preferences

  • Do not use DrissionPage native wait APIs for long “query waiting” flows; instead poll static HTML (tab.html / snapshot) and parse with parsel.Selector (or an equivalent HTML parser) to detect state transitions.
  • Do not rely on DrissionPage native “ready” checks when they are unreliable; instead implement readiness checks by parsing the static DOM for stable page markers (e.g., main content mounted, captcha/overlay shown or gone).
  • Default to ChromiumOptions().auto_port(True) during development when launching a local automation browser, so DrissionPage starts a fresh browser with an isolated port and user data directory instead of colliding with the default 127.0.0.1:9222 instance.
  • Do not enable auto_port(True) when the task requires attaching to a specific existing browser, fixed debugging port, reusable profile, or externally managed browser process; in those cases configure set_local_port(), set_address(), and set_user_data_path() explicitly.
  • Treat run_js(..., as_expr=True) as expression-only mode: never include return in that form. If the script needs return, control flow, or multiple statements, use the default function-body mode instead. When debugging unexplained polling failures, check this mismatch first because DrissionPage will throw on as_expr=True + return.
  • Pass only DrissionPage-supported primitive argument types into run_js() / run_js_loaded() / run_async_js(). Do not pass Python list, dict, None, custom objects, or other complex values directly; serialize complex data with json.dumps() and parse it inside JavaScript with JSON.parse(), and normalize optional values such as None to an empty string or another explicit primitive before calling run_js().

Workflow

1) Clarify the goal and choose a mode

Installs
28
GitHub Stars
1
First Seen
Feb 11, 2026