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 withparsel.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 default127.0.0.1:9222instance. - 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 configureset_local_port(),set_address(), andset_user_data_path()explicitly. - Treat
run_js(..., as_expr=True)as expression-only mode: never includereturnin that form. If the script needsreturn, 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 onas_expr=True+return. - Pass only DrissionPage-supported primitive argument types into
run_js()/run_js_loaded()/run_async_js(). Do not pass Pythonlist,dict,None, custom objects, or other complex values directly; serialize complex data withjson.dumps()and parse it inside JavaScript withJSON.parse(), and normalize optional values such asNoneto an empty string or another explicit primitive before callingrun_js().