Python API
Generated from the Python source; no native library is imported during this build. Use the Python tutorial for runnable examples. Timeouts use seconds.
HTTP helpers
Helpers return a live Page with a private session. Close the page or use a context manager to release both. Use Session for shared cookies and session configuration.
brimp.request
request(method, url, **kwargs)
Request a live Page using a private session.
Keyword arguments are those of Page.request. Close the page or use it as a context manager to release both page and session. Use Session directly for session configuration or cookies shared between multiple pages.
Source code in brimp/__init__.py
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 | |
brimp.get
get(url, **kwargs)
GET a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
721 722 723 | |
brimp.head
head(url, **kwargs)
HEAD a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
726 727 728 | |
brimp.post
post(url, **kwargs)
POST a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
731 732 733 | |
brimp.put
put(url, **kwargs)
PUT a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
736 737 738 | |
brimp.patch
patch(url, **kwargs)
PATCH a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
741 742 743 | |
brimp.delete
delete(url, **kwargs)
DELETE a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
746 747 748 | |
brimp.options
options(url, **kwargs)
OPTIONS a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
751 752 753 | |
brimp.trace
trace(url, **kwargs)
TRACE a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
756 757 758 | |
brimp.query
query(url, **kwargs)
QUERY a live Page. Accepts the keyword arguments of Page.request.
Source code in brimp/__init__.py
761 762 763 | |
Sessions and pages
brimp.Session
Session(*, headers=None, base_url=None, params=None, timeout=30, proxy=None, proxies=None, proxy_auth=None, trust_env=True, auth=None, plugins=None, user_agent=None, languages=None, platform=None, profile=None, time_mode='system', time_origin=None, diagnostics=None, storage_path=None)
Own pages, shared cookies, request defaults and browser subsystem plugins.
Omit plugins for the browser defaults; an explicit list replaces that set. Pass plugins=[] for core-only execution.
Use as a context manager to close all owned pages. timeout accepts numeric seconds, or None/zero to disable the deadline. The default is 30 seconds; requests inherit it unless explicitly overridden. Each request method creates a new Page; use Page.request to reuse a page. base_url resolves relative request URLs. params supplies default query values; both attributes can be changed before subsequent requests. proxy or proxies sets default proxy routing; proxy_auth supplies credentials. trust_env controls environment proxies. proxy="" forces direct connections.
Source code in brimp/__init__.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
base_url
instance-attribute
base_url = base_url
cookies
property
cookies
params
instance-attribute
params = {} if params is None else params
clear_cookies
clear_cookies()
Source code in brimp/__init__.py
255 256 | |
close
close()
Source code in brimp/__init__.py
258 259 260 261 262 263 264 | |
delete
delete(url, **kwargs)
Source code in brimp/__init__.py
110 111 | |
get
get(url, **kwargs)
Source code in brimp/__init__.py
98 99 | |
head
head(url, **kwargs)
Source code in brimp/__init__.py
113 114 | |
new_page
new_page()
Create a blank page before attaching routes, listeners or init scripts.
Source code in brimp/__init__.py
218 219 220 221 | |
options
options(url, **kwargs)
Source code in brimp/__init__.py
116 117 | |
patch
patch(url, **kwargs)
Source code in brimp/__init__.py
107 108 | |
post
post(url, **kwargs)
Source code in brimp/__init__.py
101 102 | |
put
put(url, **kwargs)
Source code in brimp/__init__.py
104 105 | |
query
query(url, **kwargs)
Source code in brimp/__init__.py
122 123 | |
request
request(method, url, **kwargs)
Navigate a new page. Keyword arguments are those of Page.request.
Source code in brimp/__init__.py
223 224 225 226 227 228 229 230 | |
route
route(pattern, handler, *, stage='request')
Register a synchronous route on all existing and future pages.
Matching page routes take precedence. Returns a removal function.
Source code in brimp/__init__.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
set_cookie
set_cookie(url, name, value)
Source code in brimp/__init__.py
248 249 | |
trace
trace(url, **kwargs)
Source code in brimp/__init__.py
119 120 | |
brimp.Page
Page(inner, session)
An HTTP result and its live DOM and JavaScript environment.
Obtain pages from Session. Navigation replaces the realm and invalidates old handles, and a successful request replaces the HTTP metadata. text and content contain the original response; html() serializes the current DOM. HTTP properties require a response: new_page() and load_html() have none. Headers and response cookies are lists of pairs. elapsed is seconds. Closing a page cancels its work; the session also owns cleanup. Pages returned by module-level helpers own a private session and close it on page closure.
Source code in brimp/__init__.py
405 406 407 408 409 410 411 | |
content
property
content
cookies
property
cookies
downloaded_bytes
property
downloaded_bytes
elapsed
property
elapsed
encoding
property
writable
encoding
Encoding used by text; override it to change response decoding.
header_bytes
property
header_bytes
headers
property
headers
history
property
history
http_version
property
http_version
reason
property
reason
request_info
property
request_info
The original HTTP request record; request() navigates the page.
status_code
property
status_code
text
property
text
uploaded_bytes
property
uploaded_bytes
url
property
url
add_init_script
add_init_script(source)
Source code in brimp/__init__.py
644 645 | |
advance_time
advance_time(milliseconds, *, max_tasks=10000)
Advance logical milliseconds, processing tasks in chronological order.
Source code in brimp/__init__.py
373 374 375 | |
clear_cache
clear_cache()
Source code in brimp/__init__.py
479 480 | |
click
click(selector)
Source code in brimp/__init__.py
647 648 | |
close
close()
Source code in brimp/__init__.py
692 693 694 695 | |
configure_network
configure_network(*, offline=False, latency=0.0, bypass_cache=False, max_retained_bytes=32 * 1024 * 1024, max_retained_body_bytes=8 * 1024 * 1024, buffered_download_bytes_per_second=None)
Source code in brimp/__init__.py
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
delete
delete(url, **kwargs)
Source code in brimp/__init__.py
110 111 | |
drag_to
drag_to(source, destination)
Source code in brimp/__init__.py
668 669 | |
evaluate
evaluate(source)
Evaluate browser JavaScript, await Promises, and copy rich bridge values.
Source code in brimp/__init__.py
630 631 632 | |
evaluate_handle
evaluate_handle(source)
Source code in brimp/__init__.py
634 635 | |
extract
extract(*, content_selector=None, remove_images=False, language=None, debug=False)
Source code in brimp/__init__.py
674 675 676 677 678 679 680 681 682 683 684 685 686 | |
fill
fill(selector, text)
Source code in brimp/__init__.py
662 663 | |
focus
focus(selector)
Source code in brimp/__init__.py
656 657 | |
get
get(url, **kwargs)
Source code in brimp/__init__.py
98 99 | |
head
head(url, **kwargs)
Source code in brimp/__init__.py
113 114 | |
hover
hover(selector)
Source code in brimp/__init__.py
650 651 | |
html
html()
Serialize the current DOM, including page-script and host edits.
Source code in brimp/__init__.py
688 689 690 | |
json
json()
Decode the original HTTP response body as JSON.
Source code in brimp/__init__.py
342 343 344 345 346 347 | |
load_html
load_html(html, url='about:blank')
Load HTML at url without running its page scripts.
The URL becomes the browsing-context URL before parsing, so relative URLs, document.URL and location.href use it. Subresources are not fetched. Init scripts still run.
Source code in brimp/__init__.py
441 442 443 444 445 446 447 448 449 450 | |
on
on(event, handler)
Subscribe a synchronous event handler; return an unsubscribe function.
Source code in brimp/__init__.py
413 414 415 416 417 418 419 420 421 422 423 | |
options
options(url, **kwargs)
Source code in brimp/__init__.py
116 117 | |
patch
patch(url, **kwargs)
Source code in brimp/__init__.py
107 108 | |
peek_diagnostics
peek_diagnostics()
Inspect retained records, coverage and loss without consuming them.
Source code in brimp/__init__.py
393 394 395 | |
post
post(url, **kwargs)
Source code in brimp/__init__.py
101 102 | |
press
press(selector, key, *, modifiers=0)
Source code in brimp/__init__.py
665 666 | |
profile_contract
profile_contract()
Describe installed profile interfaces, preserving their original field names.
Source code in brimp/__init__.py
381 382 383 | |
profile_report
profile_report()
Return defaulted paths and capture metadata without renaming profile keys.
Source code in brimp/__init__.py
385 386 387 | |
put
put(url, **kwargs)
Source code in brimp/__init__.py
104 105 | |
query
query(url, **kwargs)
Source code in brimp/__init__.py
122 123 | |
query_selector
query_selector(selector)
Source code in brimp/__init__.py
637 638 639 | |
query_selector_all
query_selector_all(selector)
Source code in brimp/__init__.py
641 642 | |
raise_for_status
raise_for_status()
Raise HTTPError for a 4xx/5xx response; otherwise return None.
HTTP statuses do not raise automatically during navigation. A page without an HTTP response raises InvalidInput.
Source code in brimp/__init__.py
349 350 351 352 353 354 355 356 357 358 | |
request
request(method, url, *, params=None, quote='', headers=None, body=None, data=None, content=None, json=None, timeout=_TIMEOUT_UNSET, allow_redirects=True, max_redirects=20, auth=None, proxy=None, proxies=None, proxy_auth=None, trust_env=None)
Navigate this page and return it with a new response snapshot.
json encodes a JSON value; content sends raw strings/bytes; data sends strings/bytes unchanged or URL-encodes a form mapping/sequence of pairs. Non-None json takes precedence over content, then data. body accepts raw strings/bytes and cannot be combined with those arguments. Explicit Content-Type headers override defaults. File/multipart uploads are unsupported. timeout accepts numeric seconds as one operation budget. None/zero disables it; omission inherits the session default. This is one navigation deadline, including JavaScript, not separate connection/read timers. HTTP error statuses remain accessible. params merges query values with session defaults. Relative URLs use the session's base_url. quote names extra characters to percent-encode; quote=False disables automatic URL quoting. Proxy overrides apply to this navigation and its redirects; subresources use session settings and routes. proxy="" forces a direct connection.
Source code in brimp/__init__.py
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 | |
response_body
response_body(request_id)
Source code in brimp/__init__.py
482 483 | |
route
route(pattern, handler, *, stage='request')
Intercept a glob pattern at request, response or auth stage.
Last matching route wins. Complete the route exactly once. The callback must be synchronous and cannot reenter this page. Returns a remover.
Source code in brimp/__init__.py
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
run_pending_tasks
run_pending_tasks(*, max_tasks=10000)
Drain currently due tasks without advancing logical time.
Source code in brimp/__init__.py
377 378 379 | |
set_extra_headers
set_extra_headers(headers)
Source code in brimp/__init__.py
476 477 | |
set_identity
set_identity(*, user_agent=None, languages=None, platform=None)
Source code in brimp/__init__.py
452 453 454 455 | |
set_input_files
set_input_files(selector, files)
Source code in brimp/__init__.py
671 672 | |
stream
stream(method, url, *, params=None, quote='', headers=None, body=None, data=None, content=None, json=None, timeout=_TIMEOUT_UNSET, allow_redirects=True, max_redirects=20, auth=None, proxy=None, proxies=None, proxy_auth=None, trust_env=None)
Stream response bytes without replacing the DOM. Close abandoned streams.
Body arguments follow request(): json, content, data or standalone body. Uploads are buffered; file-like, iterable and multipart uploads are unsupported.
Source code in brimp/__init__.py
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | |
summarize_diagnostics
summarize_diagnostics()
Group retained observations by layer/path/kind and reflection target.
Does not consume records. Counts cover the retained, filtered window; missing records do not establish that an API was never accessed.
Source code in brimp/__init__.py
397 398 399 400 401 402 403 | |
take_diagnostics
take_diagnostics()
Consume bounded records; JSONL output is unaffected.
Source code in brimp/__init__.py
389 390 391 | |
tap
tap(selector)
Source code in brimp/__init__.py
653 654 | |
trace
trace(url, **kwargs)
Source code in brimp/__init__.py
119 120 | |
type_text
type_text(selector, text)
Source code in brimp/__init__.py
659 660 | |
brimp.JSHandle
JSHandle(inner)
Rooted JavaScript value. Dispose explicitly or use a context manager.
Navigation invalidates handles from the previous realm.
Source code in brimp/__init__.py
812 813 | |
call
call(function, *args)
Source code in brimp/__init__.py
833 834 835 836 | |
delete_property
delete_property(name)
Source code in brimp/__init__.py
849 850 | |
dispose
dispose()
Source code in brimp/__init__.py
855 856 | |
invoke
invoke(*args, this=undefined)
Source code in brimp/__init__.py
838 839 840 841 | |
json_value
json_value()
Source code in brimp/__init__.py
830 831 | |
property
property(name)
Source code in brimp/__init__.py
843 844 | |
property_names
property_names()
Source code in brimp/__init__.py
852 853 | |
set_property
set_property(name, value)
Source code in brimp/__init__.py
846 847 | |
value
value()
Source code in brimp/__init__.py
827 828 | |
brimp.ElementHandle
ElementHandle(inner)
Rooted DOM node with query, edit and input methods. Detachment keeps identity.
Source code in brimp/__init__.py
812 813 | |
call
call(function, *args)
Source code in brimp/__init__.py
833 834 835 836 | |
click
click()
Source code in brimp/__init__.py
885 886 | |
delete_property
delete_property(name)
Source code in brimp/__init__.py
849 850 | |
dispose
dispose()
Source code in brimp/__init__.py
855 856 | |
focus
focus()
Source code in brimp/__init__.py
882 883 | |
get_attribute
get_attribute(name)
Source code in brimp/__init__.py
895 896 | |
html
html()
Source code in brimp/__init__.py
906 907 | |
invoke
invoke(*args, this=undefined)
Source code in brimp/__init__.py
838 839 840 841 | |
json_value
json_value()
Source code in brimp/__init__.py
830 831 | |
property
property(name)
Source code in brimp/__init__.py
843 844 | |
property_names
property_names()
Source code in brimp/__init__.py
852 853 | |
query_selector
query_selector(selector)
Source code in brimp/__init__.py
915 916 917 | |
query_selector_all
query_selector_all(selector)
Source code in brimp/__init__.py
919 920 | |
remove
remove()
Source code in brimp/__init__.py
912 913 | |
set_attribute
set_attribute(name, value)
Source code in brimp/__init__.py
898 899 900 901 | |
set_input_files
set_input_files(files)
Source code in brimp/__init__.py
888 889 | |
set_property
set_property(name, value)
Source code in brimp/__init__.py
846 847 | |
set_text_content
set_text_content(text)
Source code in brimp/__init__.py
909 910 | |
text_content
text_content()
Source code in brimp/__init__.py
903 904 | |
value
value()
Source code in brimp/__init__.py
827 828 | |
brimp.Route
Route(inner)
One intercepted request. Choose exactly one completion method.
Response-stage interception is buffered, with a 32 MiB limit.
Source code in brimp/__init__.py
934 935 936 937 938 | |
auth_challenge
instance-attribute
auth_challenge: str | None
pending
property
pending
request
instance-attribute
request: dict
response
instance-attribute
response: dict | None
stage
instance-attribute
stage: str
authenticate
authenticate(username, password)
Source code in brimp/__init__.py
987 988 | |
body
body()
Source code in brimp/__init__.py
944 945 | |
continue_request
continue_request(*, url=None, method=None, headers=None, body=None, status=None, proxy=None, proxy_auth=None)
Continue once, optionally changing request fields or its proxy.
proxy=None inherits; proxy="" connects directly. Proxy overrides are request-stage only. Supply proxy_auth when changing authenticated proxies.
Source code in brimp/__init__.py
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 | |
fail
fail(message='request aborted by route')
Source code in brimp/__init__.py
984 985 | |
fulfill
fulfill(*, status=200, headers=None, body=b'')
Source code in brimp/__init__.py
979 980 981 982 | |
brimp.StreamingResponse
StreamingResponse(inner, page)
A bounded chunk iterator. Close it when abandoning a response body.
Source code in brimp/__init__.py
998 999 1000 1001 1002 1003 1004 1005 | |
headers
instance-attribute
headers: list[tuple[str, str]]
status_code
instance-attribute
status_code: int
url
instance-attribute
url: str
close
close()
Source code in brimp/__init__.py
1016 1017 | |
Async sessions and pages
Use async with brimp.AsyncSession(...) and await requests, page operations and
handle methods. Buffered HTTP properties, json() and raise_for_status() stay
synchronous. Page callback registration stays synchronous; session routes use
await session.route(...). Handlers and removal functions remain synchronous. Async streaming and coroutine callbacks are not yet supported.
brimp.AsyncSession
AsyncSession(*, max_clients=10, **kwargs)
An asyncio session with at most max_clients concurrent native operations.
Accepts Session's keyword options. Native initialization is lazy; use async with or await close() to release resources. A session belongs to the event loop of its first use. Separate pages run concurrently; calls on one page are serialized. Completed requests do not occupy concurrency slots. Plugin and route callbacks remain synchronous in this API.
Source code in brimp/_async.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
base_url
instance-attribute
base_url = kwargs.pop('base_url', None)
cookies
property
cookies
Snapshot of the shared cookie jar; empty before first use.
max_clients
instance-attribute
max_clients = max_clients
params
instance-attribute
params = kwargs.pop('params', None)
clear_cookies
async
clear_cookies()
Source code in brimp/_async.py
162 163 | |
close
async
close()
Cancel pending work, close all pages and drain native worker threads.
Source code in brimp/_async.py
171 172 173 174 175 176 177 178 179 180 181 | |
delete
async
delete(url, **kwargs)
Source code in brimp/_async.py
41 42 | |
get
async
get(url, **kwargs)
Source code in brimp/_async.py
26 27 | |
head
async
head(url, **kwargs)
Source code in brimp/_async.py
29 30 | |
new_page
async
new_page()
Create a blank AsyncPage. The session owns its lifetime.
Source code in brimp/_async.py
140 141 142 143 | |
options
async
options(url, **kwargs)
Source code in brimp/_async.py
44 45 | |
patch
async
patch(url, **kwargs)
Source code in brimp/_async.py
38 39 | |
post
async
post(url, **kwargs)
Source code in brimp/_async.py
32 33 | |
put
async
put(url, **kwargs)
Source code in brimp/_async.py
35 36 | |
query
async
query(url, **kwargs)
Source code in brimp/_async.py
50 51 | |
request
async
request(method, url, **kwargs)
Navigate a new AsyncPage; accepts Page.request keyword arguments.
Source code in brimp/_async.py
145 146 147 148 149 150 151 152 | |
route
async
route(pattern, handler, *, stage='request')
Register a synchronous route for existing and future pages.
Source code in brimp/_async.py
154 155 156 157 | |
set_cookie
async
set_cookie(url, name, value)
Source code in brimp/_async.py
159 160 | |
trace
async
trace(url, **kwargs)
Source code in brimp/_async.py
47 48 | |
brimp.AsyncPage
AsyncPage(page, session)
A live async page with synchronous buffered HTTP properties and json().
Await navigation, JavaScript, DOM and handle operations. Cancellation stops the active native call; queued calls on this page wait for its cleanup. Use async with an existing page, or await close().
Source code in brimp/_async.py
218 219 220 221 222 | |
content
property
content
cookies
property
cookies
downloaded_bytes
property
downloaded_bytes
elapsed
property
elapsed
encoding
property
writable
encoding
Encoding used by text; override it to change response decoding.
header_bytes
property
header_bytes
headers
property
headers
history
property
history
http_version
property
http_version
reason
property
reason
request_info
property
request_info
The original HTTP request record; request() navigates the page.
status_code
property
status_code
text
property
text
uploaded_bytes
property
uploaded_bytes
url
property
url
add_init_script
async
add_init_script(source)
Source code in brimp/_async.py
352 353 | |
advance_time
async
advance_time(milliseconds, *, max_tasks=10000)
Source code in brimp/_async.py
282 283 | |
clear_cache
async
clear_cache()
Source code in brimp/_async.py
334 335 | |
click
async
click(selector)
Source code in brimp/_async.py
355 356 | |
close
async
close()
Close this page, interrupting its work without closing sibling pages.
Source code in brimp/_async.py
261 262 263 264 265 266 267 268 269 270 271 | |
configure_network
async
configure_network(*, offline=False, latency=0.0, bypass_cache=False, max_retained_bytes=32 * 1024 * 1024, max_retained_body_bytes=8 * 1024 * 1024, buffered_download_bytes_per_second=None)
Source code in brimp/_async.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
delete
async
delete(url, **kwargs)
Source code in brimp/_async.py
41 42 | |
drag_to
async
drag_to(source, destination)
Source code in brimp/_async.py
376 377 | |
evaluate
async
evaluate(source)
Source code in brimp/_async.py
340 341 | |
evaluate_handle
async
evaluate_handle(source)
Source code in brimp/_async.py
343 344 | |
extract
async
extract(*, content_selector=None, remove_images=False, language=None, debug=False)
Source code in brimp/_async.py
382 383 384 385 386 387 388 389 390 391 | |
fill
async
fill(selector, text)
Source code in brimp/_async.py
370 371 | |
focus
async
focus(selector)
Source code in brimp/_async.py
364 365 | |
get
async
get(url, **kwargs)
Source code in brimp/_async.py
26 27 | |
head
async
head(url, **kwargs)
Source code in brimp/_async.py
29 30 | |
hover
async
hover(selector)
Source code in brimp/_async.py
358 359 | |
html
async
html()
Source code in brimp/_async.py
393 394 | |
json
json()
Decode the original HTTP response body as JSON.
Source code in brimp/__init__.py
342 343 344 345 346 347 | |
load_html
async
load_html(html, url='about:blank')
Source code in brimp/_async.py
303 304 | |
on
on(event, handler)
Register a synchronous event callback; returns an unsubscribe function.
Source code in brimp/_async.py
251 252 253 254 | |
options
async
options(url, **kwargs)
Source code in brimp/_async.py
44 45 | |
patch
async
patch(url, **kwargs)
Source code in brimp/_async.py
38 39 | |
peek_diagnostics
async
peek_diagnostics()
Source code in brimp/_async.py
297 298 | |
post
async
post(url, **kwargs)
Source code in brimp/_async.py
32 33 | |
press
async
press(selector, key, *, modifiers=0)
Source code in brimp/_async.py
373 374 | |
profile_contract
async
profile_contract()
Source code in brimp/_async.py
288 289 | |
profile_report
async
profile_report()
Source code in brimp/_async.py
291 292 | |
put
async
put(url, **kwargs)
Source code in brimp/_async.py
35 36 | |
query
async
query(url, **kwargs)
Source code in brimp/_async.py
50 51 | |
query_selector
async
query_selector(selector)
Source code in brimp/_async.py
346 347 | |
query_selector_all
async
query_selector_all(selector)
Source code in brimp/_async.py
349 350 | |
raise_for_status
raise_for_status()
Raise HTTPError for a 4xx/5xx response; otherwise return None.
HTTP statuses do not raise automatically during navigation. A page without an HTTP response raises InvalidInput.
Source code in brimp/__init__.py
349 350 351 352 353 354 355 356 357 358 | |
request
async
request(method, url, **kwargs)
Navigate this page using the same options as Page.request.
Source code in brimp/_async.py
246 247 248 249 | |
response_body
async
response_body(request_id)
Source code in brimp/_async.py
337 338 | |
route
route(pattern, handler, *, stage='request')
Register a synchronous route callback; returns a removal function.
Source code in brimp/_async.py
256 257 258 259 | |
run_pending_tasks
async
run_pending_tasks(*, max_tasks=10000)
Source code in brimp/_async.py
285 286 | |
set_extra_headers
async
set_extra_headers(headers)
Source code in brimp/_async.py
331 332 | |
set_identity
async
set_identity(*, user_agent=None, languages=None, platform=None)
Source code in brimp/_async.py
306 307 308 309 | |
set_input_files
async
set_input_files(selector, files)
Source code in brimp/_async.py
379 380 | |
summarize_diagnostics
async
summarize_diagnostics()
Source code in brimp/_async.py
300 301 | |
take_diagnostics
async
take_diagnostics()
Source code in brimp/_async.py
294 295 | |
tap
async
tap(selector)
Source code in brimp/_async.py
361 362 | |
trace
async
trace(url, **kwargs)
Source code in brimp/_async.py
47 48 | |
type_text
async
type_text(selector, text)
Source code in brimp/_async.py
367 368 | |
brimp.AsyncJSHandle
AsyncJSHandle(handle, page)
An async rooted JavaScript value; await dispose() to release its root.
Source code in brimp/_async.py
400 401 | |
call
async
call(function, *args)
Source code in brimp/_async.py
415 416 | |
delete_property
async
delete_property(name)
Source code in brimp/_async.py
427 428 | |
dispose
async
dispose()
Source code in brimp/_async.py
433 434 | |
invoke
async
invoke(*args, this=undefined)
Source code in brimp/_async.py
418 419 | |
json_value
async
json_value()
Source code in brimp/_async.py
412 413 | |
property
async
property(name)
Source code in brimp/_async.py
421 422 | |
property_names
async
property_names()
Source code in brimp/_async.py
430 431 | |
set_property
async
set_property(name, value)
Source code in brimp/_async.py
424 425 | |
value
async
value()
Source code in brimp/_async.py
409 410 | |
brimp.AsyncElementHandle
AsyncElementHandle(handle, page)
An async DOM element with query, edit and input operations.
Source code in brimp/_async.py
400 401 | |
call
async
call(function, *args)
Source code in brimp/_async.py
415 416 | |
click
async
click()
Source code in brimp/_async.py
443 444 | |
delete_property
async
delete_property(name)
Source code in brimp/_async.py
427 428 | |
dispose
async
dispose()
Source code in brimp/_async.py
433 434 | |
focus
async
focus()
Source code in brimp/_async.py
440 441 | |
get_attribute
async
get_attribute(name)
Source code in brimp/_async.py
449 450 | |
html
async
html()
Source code in brimp/_async.py
458 459 | |
invoke
async
invoke(*args, this=undefined)
Source code in brimp/_async.py
418 419 | |
json_value
async
json_value()
Source code in brimp/_async.py
412 413 | |
property
async
property(name)
Source code in brimp/_async.py
421 422 | |
property_names
async
property_names()
Source code in brimp/_async.py
430 431 | |
query_selector
async
query_selector(selector)
Source code in brimp/_async.py
467 468 | |
query_selector_all
async
query_selector_all(selector)
Source code in brimp/_async.py
470 471 | |
remove
async
remove()
Source code in brimp/_async.py
464 465 | |
set_attribute
async
set_attribute(name, value)
Source code in brimp/_async.py
452 453 | |
set_input_files
async
set_input_files(files)
Source code in brimp/_async.py
446 447 | |
set_property
async
set_property(name, value)
Source code in brimp/_async.py
424 425 | |
set_text_content
async
set_text_content(text)
Source code in brimp/_async.py
461 462 | |
text_content
async
text_content()
Source code in brimp/_async.py
455 456 | |
value
async
value()
Source code in brimp/_async.py
409 410 | |
Fingerprint data
The CLI manages fingerprint catalogs. This editable data class can be supplied as
Session(profile=...) or embedded in a browser profile's network.fingerprint.
brimp.Fingerprint
dataclass
Fingerprint(client: str = '', client_version: str = '', os: str = '', os_version: str = '', http_version: str = 'v2', tls_version: str = '1.2', tls_ciphers: list[str] = list(), tls_alpn: bool = True, tls_alps: bool = False, tls_cert_compression: list[str] = list(), tls_signature_hashes: list[str] = list(), tls_key_shares_limit: int = 2, tls_supported_groups: list[str] = list(), tls_session_ticket: bool = False, tls_extension_order: str = '', tls_delegated_credentials: list[str] = list(), tls_record_size_limit: int | None = None, tls_grease: bool = False, tls_use_new_alps_codepoint: bool = False, tls_signed_cert_timestamps: bool = False, tls_ech: str | None = None, tls_permute_extensions: bool = False, tls_trust_anchors: list[str] | None = None, headers: dict[str, str] = dict(), header_order: str = '', split_cookies: bool = False, form_boundary: str = '', http2_settings: str = '', http2_window_update: int = 0, http2_pseudo_headers_order: str = '', http2_stream_weight: int | None = None, http2_stream_exclusive: int | None = None, http2_no_priority: bool = False, http3_settings: str = '', http3_pseudo_headers_order: str = '', http3_tls_extension_order: str = '', http3_headers: dict[str, str] = dict(), http3_header_order: str = '', http3_tls_supported_groups: list[str] = list(), quic_transport_parameters: str = '', quic_cid_length: str | None = None, quic_initial_packet_number: int | None = None, ws_headers: dict[str, str] = dict(), ws_header_order: str = '', ws_disable_session_ticket: bool = False, ws_tls_cert_compression: list[str] | None = None, header_lang: str = '')
Editable TLS, HTTP/2, HTTP/3, QUIC and WebSocket fingerprint data.
Pass directly as Session(profile=...) or place it at
profile["values"]["network"]["fingerprint"]. Use the CLI to manage Pro catalogs.
client
class-attribute
instance-attribute
client: str = ''
client_version
class-attribute
instance-attribute
client_version: str = ''
form_boundary
class-attribute
instance-attribute
form_boundary: str = ''
header_lang
class-attribute
instance-attribute
header_lang: str = ''
header_order
class-attribute
instance-attribute
header_order: str = ''
headers
class-attribute
instance-attribute
headers: dict[str, str] = field(default_factory=dict)
http2_no_priority
class-attribute
instance-attribute
http2_no_priority: bool = False
http2_pseudo_headers_order
class-attribute
instance-attribute
http2_pseudo_headers_order: str = ''
http2_settings
class-attribute
instance-attribute
http2_settings: str = ''
http2_stream_exclusive
class-attribute
instance-attribute
http2_stream_exclusive: int | None = None
http2_stream_weight
class-attribute
instance-attribute
http2_stream_weight: int | None = None
http2_window_update
class-attribute
instance-attribute
http2_window_update: int = 0
http3_header_order
class-attribute
instance-attribute
http3_header_order: str = ''
http3_headers
class-attribute
instance-attribute
http3_headers: dict[str, str] = field(default_factory=dict)
http3_pseudo_headers_order
class-attribute
instance-attribute
http3_pseudo_headers_order: str = ''
http3_settings
class-attribute
instance-attribute
http3_settings: str = ''
http3_tls_extension_order
class-attribute
instance-attribute
http3_tls_extension_order: str = ''
http3_tls_supported_groups
class-attribute
instance-attribute
http3_tls_supported_groups: list[str] = field(default_factory=list)
http_version
class-attribute
instance-attribute
http_version: str = 'v2'
os
class-attribute
instance-attribute
os: str = ''
os_version
class-attribute
instance-attribute
os_version: str = ''
quic_cid_length
class-attribute
instance-attribute
quic_cid_length: str | None = None
quic_initial_packet_number
class-attribute
instance-attribute
quic_initial_packet_number: int | None = None
quic_transport_parameters
class-attribute
instance-attribute
quic_transport_parameters: str = ''
split_cookies
class-attribute
instance-attribute
split_cookies: bool = False
tls_alpn
class-attribute
instance-attribute
tls_alpn: bool = True
tls_alps
class-attribute
instance-attribute
tls_alps: bool = False
tls_cert_compression
class-attribute
instance-attribute
tls_cert_compression: list[str] = field(default_factory=list)
tls_ciphers
class-attribute
instance-attribute
tls_ciphers: list[str] = field(default_factory=list)
tls_delegated_credentials
class-attribute
instance-attribute
tls_delegated_credentials: list[str] = field(default_factory=list)
tls_ech
class-attribute
instance-attribute
tls_ech: str | None = None
tls_extension_order
class-attribute
instance-attribute
tls_extension_order: str = ''
tls_grease
class-attribute
instance-attribute
tls_grease: bool = False
tls_key_shares_limit
class-attribute
instance-attribute
tls_key_shares_limit: int = 2
tls_permute_extensions
class-attribute
instance-attribute
tls_permute_extensions: bool = False
tls_record_size_limit
class-attribute
instance-attribute
tls_record_size_limit: int | None = None
tls_session_ticket
class-attribute
instance-attribute
tls_session_ticket: bool = False
tls_signature_hashes
class-attribute
instance-attribute
tls_signature_hashes: list[str] = field(default_factory=list)
tls_signed_cert_timestamps
class-attribute
instance-attribute
tls_signed_cert_timestamps: bool = False
tls_supported_groups
class-attribute
instance-attribute
tls_supported_groups: list[str] = field(default_factory=list)
tls_trust_anchors
class-attribute
instance-attribute
tls_trust_anchors: list[str] | None = None
tls_use_new_alps_codepoint
class-attribute
instance-attribute
tls_use_new_alps_codepoint: bool = False
tls_version
class-attribute
instance-attribute
tls_version: str = '1.2'
ws_disable_session_ticket
class-attribute
instance-attribute
ws_disable_session_ticket: bool = False
ws_header_order
class-attribute
instance-attribute
ws_header_order: str = ''
ws_headers
class-attribute
instance-attribute
ws_headers: dict[str, str] = field(default_factory=dict)
ws_tls_cert_compression
class-attribute
instance-attribute
ws_tls_cert_compression: list[str] | None = None