v0.4.0
Added
- 1,700+ lines of tests with 70%+ code coverage for Browser, Tab, Elem, Config, and utilities
- Tab.find_elem() / Tab.find_elems() - universal search supporting text, CSS selectors, and XPath
- Tab.wait_for_elem() / Tab.wait_for_elems() - wait for elements with configurable timeouts
- Automatic iframe traversal in element searches
- Elem.scroll_into_view() - scroll element into viewport (now public)
- Elem.focus() - set focus to elements
- Elem.position() - get element coordinates via new Position class
- Elem.query_selector() / Elem.wait_for_selector() - find child elements within an element
- Elem.parent property - traverse up DOM tree
- Position class with center, top_left, bottom_right, width, height properties
- @tab_attached decorator for graceful session closure handling
- ReferenceError exception type for detached tabs
- Browser.send() ignore_errors parameter for optional error suppression
- Config.ignore_default_args parameter for filtering Chrome arguments
- Auto domain initialization - Page and DOM domains enabled automatically on target attachment
- Support for iframe, worker, shared_worker, service_worker targets
- New default Chrome args: --accept-lang=en-US, --disable-blink-features=AutomationControlled
Removed
- Tab.init() - domain initialization now automatic
- Config.switches parameter - replaced by ignore_default_args
Changed
- Tab.select() → Tab.find_elem()
- Tab.select_all() → Tab.find_elems()
- Tab.wait_for_selector() → Tab.wait_for_elem()
- elem.node_id → elem.node (full CDP Node object, node_id accessible via getattr)
- Config(switches={...}) → Config(ignore_default_args=[...])
- Environment variable: PYPECDP_LOG_LEVEL → PYPECDP_LOGLEVEL
- Elem.set_value() now dispatches input events
- Elem.html() accepts include_shadow_dom parameter
Fixed
- Improved browser cleanup with graceful shutdown fallbacks
- Better handling of detached elements and closed sessions
- Fixed race conditions in automatic target attachment
- Enhanced session tracking and synchronization
- More robust error suppression for missing/hidden elements
Full Changelog: v0.3.0...v0.4.0