You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These additions simplify waiting and state validation before clicking/typing, reducing flakiness and making automations more predictable.
83
83
84
-
### Browser-context HTTP requests - game changer for hybrid automation!
85
-
Ever wished you could make HTTP requests that automatically inherit all your browser's session state? **Now you can!**<br>
86
-
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.
87
-
88
-
**Perfect for Hybrid Automation:**
89
-
```python
90
-
# Navigate to a site and login normally with PyDoll
-**No more session juggling** - Requests inherit browser cookies automatically
127
-
-**CORS just works** - Requests respect browser security policies
128
-
-**Perfect for modern SPAs** - Seamlessly mix UI automation with API calls
129
-
-**Authentication made easy** - Login once via UI, then hammer APIs
130
-
-**Hybrid workflows** - Use the best tool for each step (UI or API)
131
-
132
-
This opens up incredible possibilities for automation scenarios where you need both browser interaction AND API efficiency!
133
-
134
-
### New expect_download() context manager — robust file downloads made easy!
135
-
Tired of fighting with flaky download flows, missing files, or racy event listeners? Meet `tab.expect_download()`, a delightful, reliable way to handle file downloads.
136
-
137
-
- Automatically sets the browser’s download behavior
138
-
- Works with your own directory or a temporary folder (auto-cleaned!)
139
-
- Waits for completion with a timeout (so your tests don’t hang)
140
-
- Gives you a handy handle to read bytes/base64 or check `file_path`
141
-
142
-
Tiny example that just works:
143
-
144
-
```python
145
-
import asyncio
146
-
from pathlib import Path
147
-
from pydoll.browser import Chrome
148
-
149
-
asyncdefdownload_report():
150
-
asyncwith Chrome() as browser:
151
-
tab =await browser.start()
152
-
await tab.go_to('https://example.com/reports')
153
-
154
-
target_dir = Path('/tmp/my-downloads')
155
-
asyncwith tab.expect_download(keep_file_at=target_dir, timeout=10) as download:
156
-
# Trigger the download in the page (button/link/etc.)
print(f"Downloaded {len(data)} bytes to: {download.file_path}")
161
-
162
-
asyncio.run(download_report())
163
-
```
164
-
165
-
Want zero-hassle cleanup? Omit `keep_file_at` and we’ll create a temp folder and remove it automatically after the context exits. Perfect for tests.
166
-
167
-
### Total browser control with custom preferences! (thanks to [@LucasAlvws](https://github.com/LucasAlvws))
168
-
Want to completely customize how Chrome behaves? **Now you can control EVERYTHING!**<br>
169
-
The new `browser_preferences` system gives you access to hundreds of internal Chrome settings that were previously impossible to change programmatically. We're talking about deep browser customization that goes way beyond command-line flags!
170
-
171
-
**The possibilities are endless:**
172
-
```python
173
-
options = ChromiumOptions()
174
-
175
-
# Create the perfect automation environment
176
-
options.browser_preferences = {
177
-
'download': {
178
-
'default_directory': '/tmp/downloads',
179
-
'prompt_for_download': False,
180
-
'directory_upgrade': True,
181
-
'extensions_to_open': ''# Don't auto-open any downloads
This level of control was previously only available to Chrome extension developers - now it's in your automation toolkit!
245
-
246
-
Check the [documentation](https://pydoll.tech/docs/features/#custom-browser-preferences/) for more details.
247
-
248
-
### New `get_parent_element()` method
249
-
Retrieve the parent of any WebElement, making it easier to navigate the DOM structure:
250
-
```python
251
-
element =await tab.find(id='button')
252
-
parent =await element.get_parent_element()
253
-
```
254
-
### New start_timeout option (thanks to [@j0j1j2](https://github.com/j0j1j2))
255
-
Added to ChromiumOptions to control how long the browser can take to start. Useful on slower machines or CI environments.
256
-
257
-
```python
258
-
options = ChromiumOptions()
259
-
options.start_timeout =20# wait 20 seconds
260
-
```
261
84
262
85
## 📦 Installation
263
86
@@ -426,6 +249,7 @@ Pydoll offers a series of advanced features to please even the most
426
249
demanding users.
427
250
428
251
252
+
429
253
### Advanced Element Search
430
254
431
255
We have several ways to find elements on the page. No matter how you prefer, we have a way that makes sense for you:
@@ -472,6 +296,170 @@ The `find` method is more user-friendly. We can search by common attributes like
472
296
If that's not enough, we can use the `query` method to search for elements using CSS selectors, XPath queries, etc. Pydoll automatically takes care of identifying what type of query we're using.
473
297
474
298
299
+
### Browser-context HTTP requests - game changer for hybrid automation!
300
+
Ever wished you could make HTTP requests that automatically inherit all your browser's session state? **Now you can!**<br>
301
+
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.
302
+
303
+
**Perfect for Hybrid Automation:**
304
+
```python
305
+
# Navigate to a site and login normally with PyDoll
-**No more session juggling** - Requests inherit browser cookies automatically
342
+
-**CORS just works** - Requests respect browser security policies
343
+
-**Perfect for modern SPAs** - Seamlessly mix UI automation with API calls
344
+
-**Authentication made easy** - Login once via UI, then hammer APIs
345
+
-**Hybrid workflows** - Use the best tool for each step (UI or API)
346
+
347
+
This opens up incredible possibilities for automation scenarios where you need both browser interaction AND API efficiency!
348
+
349
+
### New expect_download() context manager — robust file downloads made easy!
350
+
Tired of fighting with flaky download flows, missing files, or racy event listeners? Meet `tab.expect_download()`, a delightful, reliable way to handle file downloads.
351
+
352
+
- Automatically sets the browser’s download behavior
353
+
- Works with your own directory or a temporary folder (auto-cleaned!)
354
+
- Waits for completion with a timeout (so your tests don’t hang)
355
+
- Gives you a handy handle to read bytes/base64 or check `file_path`
356
+
357
+
Tiny example that just works:
358
+
359
+
```python
360
+
import asyncio
361
+
from pathlib import Path
362
+
from pydoll.browser import Chrome
363
+
364
+
asyncdefdownload_report():
365
+
asyncwith Chrome() as browser:
366
+
tab =await browser.start()
367
+
await tab.go_to('https://example.com/reports')
368
+
369
+
target_dir = Path('/tmp/my-downloads')
370
+
asyncwith tab.expect_download(keep_file_at=target_dir, timeout=10) as download:
371
+
# Trigger the download in the page (button/link/etc.)
print(f"Downloaded {len(data)} bytes to: {download.file_path}")
376
+
377
+
asyncio.run(download_report())
378
+
```
379
+
380
+
Want zero-hassle cleanup? Omit `keep_file_at` and we’ll create a temp folder and remove it automatically after the context exits. Perfect for tests.
381
+
382
+
### Total browser control with custom preferences! (thanks to [@LucasAlvws](https://github.com/LucasAlvws))
383
+
Want to completely customize how Chrome behaves? **Now you can control EVERYTHING!**<br>
384
+
The new `browser_preferences` system gives you access to hundreds of internal Chrome settings that were previously impossible to change programmatically. We're talking about deep browser customization that goes way beyond command-line flags!
385
+
386
+
**The possibilities are endless:**
387
+
```python
388
+
options = ChromiumOptions()
389
+
390
+
# Create the perfect automation environment
391
+
options.browser_preferences = {
392
+
'download': {
393
+
'default_directory': '/tmp/downloads',
394
+
'prompt_for_download': False,
395
+
'directory_upgrade': True,
396
+
'extensions_to_open': ''# Don't auto-open any downloads
This level of control was previously only available to Chrome extension developers - now it's in your automation toolkit!
460
+
461
+
Check the [documentation](https://pydoll.tech/docs/features/#custom-browser-preferences/) for more details.
462
+
475
463
### Concurrent Automation
476
464
477
465
One of the great advantages of Pydoll is the ability to process multiple tasks simultaneously thanks to its asynchronous implementation. We can automate multiple tabs
0 commit comments