anchorbrowser 0.4.0__py3-none-any.whl → 0.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anchorbrowser/_base_client.py +8 -2
- anchorbrowser/_version.py +1 -1
- anchorbrowser/lib/browser.py +1 -0
- anchorbrowser/resources/sessions/mouse.py +38 -10
- anchorbrowser/types/sessions/mouse_click_params.py +23 -6
- anchorbrowser/types/tool_perform_web_task_params.py +3 -0
- {anchorbrowser-0.4.0.dist-info → anchorbrowser-0.5.1.dist-info}/METADATA +1 -1
- {anchorbrowser-0.4.0.dist-info → anchorbrowser-0.5.1.dist-info}/RECORD +10 -10
- {anchorbrowser-0.4.0.dist-info → anchorbrowser-0.5.1.dist-info}/WHEEL +0 -0
- {anchorbrowser-0.4.0.dist-info → anchorbrowser-0.5.1.dist-info}/licenses/LICENSE +0 -0
anchorbrowser/_base_client.py
CHANGED
|
@@ -1247,9 +1247,12 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
1247
1247
|
*,
|
|
1248
1248
|
cast_to: Type[ResponseT],
|
|
1249
1249
|
body: Body | None = None,
|
|
1250
|
+
files: RequestFiles | None = None,
|
|
1250
1251
|
options: RequestOptions = {},
|
|
1251
1252
|
) -> ResponseT:
|
|
1252
|
-
opts = FinalRequestOptions.construct(
|
|
1253
|
+
opts = FinalRequestOptions.construct(
|
|
1254
|
+
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
|
|
1255
|
+
)
|
|
1253
1256
|
return self.request(cast_to, opts)
|
|
1254
1257
|
|
|
1255
1258
|
def put(
|
|
@@ -1767,9 +1770,12 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1767
1770
|
*,
|
|
1768
1771
|
cast_to: Type[ResponseT],
|
|
1769
1772
|
body: Body | None = None,
|
|
1773
|
+
files: RequestFiles | None = None,
|
|
1770
1774
|
options: RequestOptions = {},
|
|
1771
1775
|
) -> ResponseT:
|
|
1772
|
-
opts = FinalRequestOptions.construct(
|
|
1776
|
+
opts = FinalRequestOptions.construct(
|
|
1777
|
+
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
|
|
1778
|
+
)
|
|
1773
1779
|
return await self.request(cast_to, opts)
|
|
1774
1780
|
|
|
1775
1781
|
async def put(
|
anchorbrowser/_version.py
CHANGED
anchorbrowser/lib/browser.py
CHANGED
|
@@ -49,9 +49,12 @@ class MouseResource(SyncAPIResource):
|
|
|
49
49
|
self,
|
|
50
50
|
session_id: str,
|
|
51
51
|
*,
|
|
52
|
-
x: int,
|
|
53
|
-
y: int,
|
|
54
52
|
button: Literal["left", "middle", "right"] | Omit = omit,
|
|
53
|
+
index: float | Omit = omit,
|
|
54
|
+
selector: str | Omit = omit,
|
|
55
|
+
selector_timeout_ms: float | Omit = omit,
|
|
56
|
+
x: float | Omit = omit,
|
|
57
|
+
y: float | Omit = omit,
|
|
55
58
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
56
59
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
57
60
|
extra_headers: Headers | None = None,
|
|
@@ -63,12 +66,20 @@ class MouseResource(SyncAPIResource):
|
|
|
63
66
|
Performs a mouse click at the specified coordinates
|
|
64
67
|
|
|
65
68
|
Args:
|
|
69
|
+
button: Mouse button to use
|
|
70
|
+
|
|
71
|
+
index: If a selector was passed and multiple elements match the selector, the index of
|
|
72
|
+
the element in the list (0-based). Defaults to 0.
|
|
73
|
+
|
|
74
|
+
selector: A valid CSS selector for the requested element
|
|
75
|
+
|
|
76
|
+
selector_timeout_ms: If a selector was passed, timeout in ms for waiting for the DOM element to be
|
|
77
|
+
selected. Defaults to 5000 (5 seconds).
|
|
78
|
+
|
|
66
79
|
x: X coordinate
|
|
67
80
|
|
|
68
81
|
y: Y coordinate
|
|
69
82
|
|
|
70
|
-
button: Mouse button to use
|
|
71
|
-
|
|
72
83
|
extra_headers: Send extra headers
|
|
73
84
|
|
|
74
85
|
extra_query: Add additional query parameters to the request
|
|
@@ -83,9 +94,12 @@ class MouseResource(SyncAPIResource):
|
|
|
83
94
|
f"/v1/sessions/{session_id}/mouse/click",
|
|
84
95
|
body=maybe_transform(
|
|
85
96
|
{
|
|
97
|
+
"button": button,
|
|
98
|
+
"index": index,
|
|
99
|
+
"selector": selector,
|
|
100
|
+
"selector_timeout_ms": selector_timeout_ms,
|
|
86
101
|
"x": x,
|
|
87
102
|
"y": y,
|
|
88
|
-
"button": button,
|
|
89
103
|
},
|
|
90
104
|
mouse_click_params.MouseClickParams,
|
|
91
105
|
),
|
|
@@ -216,9 +230,12 @@ class AsyncMouseResource(AsyncAPIResource):
|
|
|
216
230
|
self,
|
|
217
231
|
session_id: str,
|
|
218
232
|
*,
|
|
219
|
-
x: int,
|
|
220
|
-
y: int,
|
|
221
233
|
button: Literal["left", "middle", "right"] | Omit = omit,
|
|
234
|
+
index: float | Omit = omit,
|
|
235
|
+
selector: str | Omit = omit,
|
|
236
|
+
selector_timeout_ms: float | Omit = omit,
|
|
237
|
+
x: float | Omit = omit,
|
|
238
|
+
y: float | Omit = omit,
|
|
222
239
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
223
240
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
224
241
|
extra_headers: Headers | None = None,
|
|
@@ -230,12 +247,20 @@ class AsyncMouseResource(AsyncAPIResource):
|
|
|
230
247
|
Performs a mouse click at the specified coordinates
|
|
231
248
|
|
|
232
249
|
Args:
|
|
250
|
+
button: Mouse button to use
|
|
251
|
+
|
|
252
|
+
index: If a selector was passed and multiple elements match the selector, the index of
|
|
253
|
+
the element in the list (0-based). Defaults to 0.
|
|
254
|
+
|
|
255
|
+
selector: A valid CSS selector for the requested element
|
|
256
|
+
|
|
257
|
+
selector_timeout_ms: If a selector was passed, timeout in ms for waiting for the DOM element to be
|
|
258
|
+
selected. Defaults to 5000 (5 seconds).
|
|
259
|
+
|
|
233
260
|
x: X coordinate
|
|
234
261
|
|
|
235
262
|
y: Y coordinate
|
|
236
263
|
|
|
237
|
-
button: Mouse button to use
|
|
238
|
-
|
|
239
264
|
extra_headers: Send extra headers
|
|
240
265
|
|
|
241
266
|
extra_query: Add additional query parameters to the request
|
|
@@ -250,9 +275,12 @@ class AsyncMouseResource(AsyncAPIResource):
|
|
|
250
275
|
f"/v1/sessions/{session_id}/mouse/click",
|
|
251
276
|
body=await async_maybe_transform(
|
|
252
277
|
{
|
|
278
|
+
"button": button,
|
|
279
|
+
"index": index,
|
|
280
|
+
"selector": selector,
|
|
281
|
+
"selector_timeout_ms": selector_timeout_ms,
|
|
253
282
|
"x": x,
|
|
254
283
|
"y": y,
|
|
255
|
-
"button": button,
|
|
256
284
|
},
|
|
257
285
|
mouse_click_params.MouseClickParams,
|
|
258
286
|
),
|
|
@@ -2,17 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing_extensions import Literal,
|
|
5
|
+
from typing_extensions import Literal, Annotated, TypedDict
|
|
6
|
+
|
|
7
|
+
from ..._utils import PropertyInfo
|
|
6
8
|
|
|
7
9
|
__all__ = ["MouseClickParams"]
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
class MouseClickParams(TypedDict, total=False):
|
|
11
|
-
|
|
13
|
+
button: Literal["left", "middle", "right"]
|
|
14
|
+
"""Mouse button to use"""
|
|
15
|
+
|
|
16
|
+
index: float
|
|
17
|
+
"""
|
|
18
|
+
If a selector was passed and multiple elements match the selector, the index of
|
|
19
|
+
the element in the list (0-based). Defaults to 0.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
selector: str
|
|
23
|
+
"""A valid CSS selector for the requested element"""
|
|
24
|
+
|
|
25
|
+
selector_timeout_ms: Annotated[float, PropertyInfo(alias="timeout")]
|
|
26
|
+
"""
|
|
27
|
+
If a selector was passed, timeout in ms for waiting for the DOM element to be
|
|
28
|
+
selected. Defaults to 5000 (5 seconds).
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
x: float
|
|
12
32
|
"""X coordinate"""
|
|
13
33
|
|
|
14
|
-
y:
|
|
34
|
+
y: float
|
|
15
35
|
"""Y coordinate"""
|
|
16
|
-
|
|
17
|
-
button: Literal["left", "middle", "right"]
|
|
18
|
-
"""Mouse button to use"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: anchorbrowser
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.1
|
|
4
4
|
Summary: The official Python library for the anchorbrowser API
|
|
5
5
|
Project-URL: Homepage, https://github.com/anchorbrowser/AnchorBrowser-SDK-Python
|
|
6
6
|
Project-URL: Repository, https://github.com/anchorbrowser/AnchorBrowser-SDK-Python
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
anchorbrowser/__init__.py,sha256=Wl16NhVAsaRBCpDtHZjZXDY31QMKfCIRNjzJcfb8D9E,2728
|
|
2
|
-
anchorbrowser/_base_client.py,sha256=
|
|
2
|
+
anchorbrowser/_base_client.py,sha256=3FSjbo_FJTd21pzokFG_tuMxFMaUbGbiYKh3ds8KaWo,67242
|
|
3
3
|
anchorbrowser/_client.py,sha256=kOirdFb7E1Ka4i8OmYvReMdFN4L-uvY9l_X2Zk-lNXs,19478
|
|
4
4
|
anchorbrowser/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
|
|
5
5
|
anchorbrowser/_constants.py,sha256=rKs4WwdZfRAvd1f_BWJm7vbaHYIdDm7Z7tz5NQKGbPM,468
|
|
@@ -11,7 +11,7 @@ anchorbrowser/_resource.py,sha256=7lE1EgpVj5kwckk-27umtigTOf9nKTyRl97cgNwRbRQ,11
|
|
|
11
11
|
anchorbrowser/_response.py,sha256=xsiyWOC8LWW-NvbFtZ-MJD4f7eI9RnivKwtKImZ-8o4,28860
|
|
12
12
|
anchorbrowser/_streaming.py,sha256=ey2jst1hntYHV6HDiCFfHhWr_dUCSG4dG-VUqQkmCQ4,10249
|
|
13
13
|
anchorbrowser/_types.py,sha256=nAsmJDL_VDIWprgQ9LdTLnW1NtUssCOAD8OKIqeaHQ8,7302
|
|
14
|
-
anchorbrowser/_version.py,sha256=
|
|
14
|
+
anchorbrowser/_version.py,sha256=bJaKB6MIiPWv2LwcQCcwzhFGlI5jtuEOL-z_HYvSB_k,165
|
|
15
15
|
anchorbrowser/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
anchorbrowser/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
17
17
|
anchorbrowser/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
@@ -27,7 +27,7 @@ anchorbrowser/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZ
|
|
|
27
27
|
anchorbrowser/_utils/_utils.py,sha256=ugfUaneOK7I8h9b3656flwf5u_kthY0gvNuqvgOLoSU,12252
|
|
28
28
|
anchorbrowser/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
29
29
|
anchorbrowser/lib/agent.py,sha256=bPaGn2-Eta1HL0hB0cClL9WSmjwRfHphruBofq1oVvI,3533
|
|
30
|
-
anchorbrowser/lib/browser.py,sha256=
|
|
30
|
+
anchorbrowser/lib/browser.py,sha256=Bq1HBeoxErULdMG8DajDglp3dUP68XMiW94C8YDCleE,6387
|
|
31
31
|
anchorbrowser/resources/__init__.py,sha256=7EiFSg_zGe3PD-8qVTwpphzf2YNWHbUOzHt-iE607IA,3369
|
|
32
32
|
anchorbrowser/resources/agent.py,sha256=-pceCs4e76Ofe-yAfSU_AjNekTl7EWWk3NiDcCf6pKI,19597
|
|
33
33
|
anchorbrowser/resources/browser.py,sha256=BB5hq_ayIDL_ziYHq13oj8US3XkHzkoXiGLBm7h9dH0,5548
|
|
@@ -41,7 +41,7 @@ anchorbrowser/resources/sessions/__init__.py,sha256=51tmuaKqEsEMfFTtZOovPAid6vYy
|
|
|
41
41
|
anchorbrowser/resources/sessions/all.py,sha256=5iN5Vv6UW-2p07lEqiRHw3fFQC4m_acfvsn3yZVi_g0,7193
|
|
42
42
|
anchorbrowser/resources/sessions/clipboard.py,sha256=RuoY6Ev5oKsuk0KhPgtRk5GXCjqCk2D16e2hXzRY-4I,9572
|
|
43
43
|
anchorbrowser/resources/sessions/keyboard.py,sha256=qeHOvmTC2cA_AcEyXBCTzp6QyjN-cU6BZBq603Ex49g,11024
|
|
44
|
-
anchorbrowser/resources/sessions/mouse.py,sha256=
|
|
44
|
+
anchorbrowser/resources/sessions/mouse.py,sha256=OA9kcEfTCFVRzwPah799f3LqkB8u1x80H7NLxNn2m_o,16154
|
|
45
45
|
anchorbrowser/resources/sessions/sessions.py,sha256=yR1B39poMSxn4EfO_bJlQbH-LShXD6RZCgQOzOs1JgM,56323
|
|
46
46
|
anchorbrowser/resources/sessions/agent/__init__.py,sha256=xhYEyZLlwYxvBVBNX6FfdOYz9B5Ps4bHXNG_LY1KuDU,976
|
|
47
47
|
anchorbrowser/resources/sessions/agent/agent.py,sha256=VnrjYHkp6jDv3mYUUnfC6xxcrjwO1Uwm5bWAY85We8w,10013
|
|
@@ -88,7 +88,7 @@ anchorbrowser/types/task_run_params.py,sha256=U-5fDfwftOkHNBbnMDkQTK0qWVpUT4EdEb
|
|
|
88
88
|
anchorbrowser/types/task_run_response.py,sha256=Vy33PwbYTneLeAe0rAi_K6nr4M4uwMg4fzgvf0bBe3w,830
|
|
89
89
|
anchorbrowser/types/tool_fetch_webpage_params.py,sha256=g_C7tLpyFx4I2r7-iizM7ZiQ71-VfowCj9aufaSHjmg,1181
|
|
90
90
|
anchorbrowser/types/tool_fetch_webpage_response.py,sha256=hdbrNgPz_LeWa3_aVbtck-n-SRvO4moFDbGoSf_2_tU,210
|
|
91
|
-
anchorbrowser/types/tool_perform_web_task_params.py,sha256=
|
|
91
|
+
anchorbrowser/types/tool_perform_web_task_params.py,sha256=rFEGtjZWtXA8wLLp36GLt9NuD7HO0dKSqDHp5GfFZYA,2219
|
|
92
92
|
anchorbrowser/types/tool_perform_web_task_response.py,sha256=c7GCKQxXNql6UxXDXcRcetxUg0lOHd5lB4DdbKoKwh4,400
|
|
93
93
|
anchorbrowser/types/tool_screenshot_webpage_params.py,sha256=a7p4nCi6mQRJvTZD3wYDa67UGsB4v4CqOhW6x8-9Rrk,1344
|
|
94
94
|
anchorbrowser/types/sessions/__init__.py,sha256=kiMjL-pt4Umx2DAnt8UP8lo4eM9X_UBDXO7JdYBzpcs,1493
|
|
@@ -100,7 +100,7 @@ anchorbrowser/types/sessions/keyboard_shortcut_params.py,sha256=L2B21JzcdhfQm_cp
|
|
|
100
100
|
anchorbrowser/types/sessions/keyboard_shortcut_response.py,sha256=poGYtbLwGMUpkdQi-JX-4whoxoYYl8sv36zAh5ifJ2U,267
|
|
101
101
|
anchorbrowser/types/sessions/keyboard_type_params.py,sha256=1nBPL28krDY429UBwWCGJJylPXxVPjd3LnfKz0InwFg,373
|
|
102
102
|
anchorbrowser/types/sessions/keyboard_type_response.py,sha256=SzP4ku4K9Fii94MoGtnYdsrFgv4jfwMoQLOJl95RoH4,259
|
|
103
|
-
anchorbrowser/types/sessions/mouse_click_params.py,sha256=
|
|
103
|
+
anchorbrowser/types/sessions/mouse_click_params.py,sha256=k71W2LHB0wBEmevlvlzEjWahKDanZpGRHMnkYtLfG4o,916
|
|
104
104
|
anchorbrowser/types/sessions/mouse_click_response.py,sha256=kr49gpE4B_c_IMCASSzWQYNG2o4FLM1C3vx9HEmUG2o,255
|
|
105
105
|
anchorbrowser/types/sessions/mouse_double_click_params.py,sha256=ivYklkipERNnLLxKEdXlKw8GqRa_qrxTnkFhC6KwV8c,443
|
|
106
106
|
anchorbrowser/types/sessions/mouse_double_click_response.py,sha256=D_d8D4O0fzZ3LyH6qp1Cfkig2aKLuJ5XBc_08YwbyvE,267
|
|
@@ -116,7 +116,7 @@ anchorbrowser/types/sessions/agent/file_upload_response.py,sha256=9DnqplfvEud89U
|
|
|
116
116
|
anchorbrowser/types/sessions/recordings/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
|
|
117
117
|
anchorbrowser/types/shared/__init__.py,sha256=FQKjY3VDxI8T0feNRazdY5TOqb2KDeEwZaoJjsxuEl4,152
|
|
118
118
|
anchorbrowser/types/shared/success_response.py,sha256=l9OWrucXoSjBdsx5QKdvBPFtxv8d0YdpYY6iL5cWWuc,314
|
|
119
|
-
anchorbrowser-0.
|
|
120
|
-
anchorbrowser-0.
|
|
121
|
-
anchorbrowser-0.
|
|
122
|
-
anchorbrowser-0.
|
|
119
|
+
anchorbrowser-0.5.1.dist-info/METADATA,sha256=ulLDd9Zs1Vm4q0zHIVy2CBToZTox-J-RUVTnh25GP0w,15407
|
|
120
|
+
anchorbrowser-0.5.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
121
|
+
anchorbrowser-0.5.1.dist-info/licenses/LICENSE,sha256=QYTH6OztHxnELDn890vME8F7-euzmsHhWI4XOSYxwOg,11343
|
|
122
|
+
anchorbrowser-0.5.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|