Repository navigation
docs: document the body and HTML opt-ins in the API reference - #13
Merged
Merged
Conversation
The generated reference dropped property docstrings and kept only the first paragraph of response(), so it never said that inner_html and outer_html need html=True, or that body_encoding=True also fetches the body. Emit property docstrings, fold the body_encoding note into the response() summary, give the sync ElementHandle HTML properties the same docstrings as the async ones, and say that reading the HTML without html=True raises BAPValueError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
artiom
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The generated API reference left out two things that 0.3.0 users need to know:
inner_htmlandouter_htmlneedhtml=Trueon the query. The asyncElementHandleproperties say so in their docstrings, but the reference generator ignored property docstrings, and the sync properties had none. The reference showed onlyType: str | None.body_encoding=Truefetches the body by itself.response()said this in a second paragraph, and the generator keeps only the first paragraph, so the reference read "fetch bodies only with body=True".Changes:
scripts/codegen/emit_docs.py: write each property's docstring summary under itsType:line.response()(async and sync): one-paragraph docstring: "List responses. Bodies are fetched only with body=True or body_encoding=True; body_encoding=True also adds the base64Encoded flag."ElementHandle.inner_html/outer_html: the same docstrings as the async properties.query_selector/query_selector_alldocs: add that readinginner_htmlorouter_htmlwithouthtml=TrueraisesBAPValueError._page_generated.pywas regenerated from this.tests/test_codegen_docs.py: check that all three notes appear in the generated pages.Only docstrings and the docs generator change. Runtime behavior does not.
Related issues
None.
Type of change
Checklist
ruff format --check .ruff check .mypypytest -m "not e2e"(347 passed)python scripts/codegen.pyleaves no difftype: summary)Notes for reviewers
The docs site's reference is updated from this branch in a separate docs change.
🤖 Generated with Claude Code
Summary by CodeRabbit
html=Truewhen querying elements; accessing them otherwise raisesBAPValueError.body=Trueorbody_encoding=True, and thatbody_encoding=Trueadds a base64-encoding flag.