Skip to content

Commit 029b286

Browse files
authored
Merge branch 'autoscrape-labs:main' into issue-214
2 parents 03019ee + 2a2039b commit 029b286

File tree

134 files changed

+522
-18501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+522
-18501
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## 2.7.0 (2025-08-22)
2+
3+
### Feat
4+
5+
- refactor WebElement methods to use a unified naming convention
6+
- add Response type and new bring_to_front method to Tab class
7+
- improve element interactability scripts
8+
9+
### Fix
10+
11+
- **browser**: add google-chrome-stable path for Arch Linux AUR package
12+
- run actions to fix badges
13+
- enforce combined condition logic in wait_until
14+
- **web_element**: raise WaitElementTimeout on wait_until timeout
15+
16+
### Refactor
17+
18+
- update command responses to use Response for empty responses
19+
- **webelement**: simplify wait_until condition mapping
20+
121
## 2.6.0 (2025-08-10)
222

323
### Feat

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,40 @@ We believe that powerful automation shouldn't require you to become an expert in
4747

4848
## What's New
4949

50+
### WebElement: state waiting and new public APIs
51+
52+
- New `wait_until(...)` on `WebElement` to await element states with minimal code:
53+
54+
```python
55+
# Wait until it becomes visible OR the timeout expires
56+
await element.wait_until(is_visible=True, timeout=5)
57+
58+
# Wait until it becomes interactable (visible, on top, receiving pointer events)
59+
await element.wait_until(is_interactable=True, timeout=10)
60+
```
61+
62+
- Methods now public on `WebElement`:
63+
- `is_visible()`
64+
- Checks that the element has a visible area (> 0), isn’t hidden by CSS and is in the viewport (after `scroll_into_view()` when needed). Useful pre-check before interactions.
65+
- `is_interactable()`
66+
- “Click-ready” state: combines visibility, enabledness and pointer-event hit testing. Ideal for robust flows that avoid lost clicks.
67+
- `is_on_top()`
68+
- Verifies the element is the top hit-test target at the intended click point, avoiding overlays.
69+
- `execute_script(script: str, return_by_value: bool = False)`
70+
- Executes JavaScript in the element’s own context (where `this` is the element). Great for fine-tuning and quick inspections.
71+
72+
```python
73+
# Visually outline the element via JS
74+
await element.execute_script("this.style.outline='2px solid #22d3ee'")
75+
76+
# Confirm states
77+
visible = await element.is_visible()
78+
interactable = await element.is_interactable()
79+
on_top = await element.is_on_top()
80+
```
81+
82+
These additions simplify waiting and state validation before clicking/typing, reducing flakiness and making automations more predictable.
83+
5084
### Browser-context HTTP requests - game changer for hybrid automation!
5185
Ever wished you could make HTTP requests that automatically inherit all your browser's session state? **Now you can!**<br>
5286
The `tab.request` property gives you a beautiful `requests`-like interface that executes HTTP calls directly in the browser's JavaScript context. This means every request automatically gets cookies, authentication headers, CORS policies, and session state, just as if the browser made the request itself.

README_zh.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,40 @@ Pydoll 采用全新设计理念,从零构建,直接对接 Chrome DevTools Pr
4949

5050
## 最新功能
5151

52+
### WebElement:状态等待与新的公共 API
53+
54+
- 新增 `wait_until(...)` 用于等待元素状态,使用更简单:
55+
56+
```python
57+
# 等待元素变为可见,直到超时
58+
await element.wait_until(is_visible=True, timeout=5)
59+
60+
# 等待元素变为可交互(可见、位于顶层并可接收事件)
61+
await element.wait_until(is_interactable=True, timeout=10)
62+
```
63+
64+
- 以下 `WebElement` 方法现已公开:
65+
- `is_visible()`
66+
- 判断元素是否具有可见区域、未被 CSS 隐藏,并在需要时滚动进入视口。适用于交互前的快速校验。
67+
- `is_interactable()`
68+
- “可点击”状态:综合可见性、启用状态与指针事件命中等条件,适合构建更稳健的交互流程。
69+
- `is_on_top()`
70+
- 检查元素在点击位置是否为顶部命中目标,避免被覆盖导致点击失效。
71+
- `execute_script(script: str, return_by_value: bool = False)`
72+
- 在元素上下文中执行 JavaScript(this 指向该元素),便于细粒度调整与快速检查。
73+
74+
```python
75+
# 使用 JS 高亮元素
76+
await element.execute_script("this.style.outline='2px solid #22d3ee'")
77+
78+
# 校验状态
79+
visible = await element.is_visible()
80+
interactable = await element.is_interactable()
81+
on_top = await element.is_on_top()
82+
```
83+
84+
以上新增能力能显著简化“等待+验证”场景,降低自动化过程中的不稳定性,使用例更可预测。
85+
5286
### 浏览器上下文 HTTP 请求 - 混合自动化的游戏规则改变者!
5387
你是否曾经希望能够发出自动继承浏览器所有会话状态的 HTTP 请求?**现在你可以了!**<br>
5488
`tab.request` 属性为你提供了一个美观的 `requests` 风格接口,可在浏览器的 JavaScript 上下文中直接执行 HTTP 调用。这意味着每个请求都会自动获得 cookies、身份验证标头、CORS 策略和会话状态,就像浏览器本身发出请求一样。

cz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
commitizen:
33
name: cz_conventional_commits
44
tag_format: $version
5-
version: 2.6.0
5+
version: 2.7.0

docs/api/browser/chrome.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/api/browser/edge.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/api/browser/managers.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

docs/api/browser/options.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/api/browser/requests.md

Lines changed: 0 additions & 139 deletions
This file was deleted.

docs/api/browser/tab.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)