playwright-ruby-client 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/documentation/docs/api/browser.md +2 -0
- data/documentation/docs/api/browser_context.md +2 -3
- data/documentation/docs/api/dialog.md +15 -18
- data/documentation/docs/api/element_handle.md +28 -50
- data/documentation/docs/api/experimental/android_device.md +1 -0
- data/documentation/docs/api/file_chooser.md +4 -5
- data/documentation/docs/api/frame.md +3 -4
- data/documentation/docs/api/js_handle.md +11 -14
- data/documentation/docs/api/page.md +163 -230
- data/documentation/docs/api/worker.md +18 -1
- data/documentation/docs/include/api_coverage.md +3 -1
- data/lib/playwright/channel_owners/binding_call.rb +1 -1
- data/lib/playwright/channel_owners/page.rb +6 -6
- data/lib/playwright/channel_owners/worker.rb +4 -0
- data/lib/playwright/playwright_api.rb +16 -1
- data/lib/playwright/version.rb +1 -1
- data/lib/playwright_api/android.rb +6 -6
- data/lib/playwright_api/android_device.rb +8 -7
- data/lib/playwright_api/browser.rb +10 -8
- data/lib/playwright_api/browser_context.rb +11 -12
- data/lib/playwright_api/browser_type.rb +7 -6
- data/lib/playwright_api/console_message.rb +6 -6
- data/lib/playwright_api/dialog.rb +6 -6
- data/lib/playwright_api/element_handle.rb +6 -6
- data/lib/playwright_api/frame.rb +6 -6
- data/lib/playwright_api/js_handle.rb +6 -6
- data/lib/playwright_api/page.rb +32 -18
- data/lib/playwright_api/playwright.rb +6 -6
- data/lib/playwright_api/request.rb +6 -6
- data/lib/playwright_api/response.rb +8 -8
- data/lib/playwright_api/route.rb +6 -6
- data/lib/playwright_api/selectors.rb +6 -6
- data/lib/playwright_api/worker.rb +22 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 623dc9bf11ce77bda6cd9006c727e31060564810bac0ccf5f06aabffc5976c07
|
4
|
+
data.tar.gz: 206995c24a6cbd4dcd6867eaa076e3b3052b7a7056cd63188a7ebb0e54c38056
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a341d042e6e35b5205f56303efda6fe9a34e857c12696622c366f0ebbc113816b3418e05e87b8fe60867ae2252964a36545b8bd782cf61f9c23f42e868cb098a
|
7
|
+
data.tar.gz: 68fc458f0fc750c208f8daa7f900ef33977987aa6684db4edea20c42cf5f3837deb4e5b828385fd9c25d11769ff1b345cdb795aef370158bd009a515dfeeb54d
|
@@ -85,6 +85,7 @@ def new_context(
|
|
85
85
|
record_har_path: nil,
|
86
86
|
record_video_dir: nil,
|
87
87
|
record_video_size: nil,
|
88
|
+
reducedMotion: nil,
|
88
89
|
screen: nil,
|
89
90
|
storageState: nil,
|
90
91
|
timezoneId: nil,
|
@@ -132,6 +133,7 @@ def new_page(
|
|
132
133
|
record_har_path: nil,
|
133
134
|
record_video_dir: nil,
|
134
135
|
record_video_size: nil,
|
136
|
+
reducedMotion: nil,
|
135
137
|
screen: nil,
|
136
138
|
storageState: nil,
|
137
139
|
timezoneId: nil,
|
@@ -131,8 +131,7 @@ The method adds a function called `name` on the `window` object of every frame i
|
|
131
131
|
called, the function executes `callback` and returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which resolves to the return value of `callback`. If
|
132
132
|
the `callback` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), it will be awaited.
|
133
133
|
|
134
|
-
The first argument of the `callback` function contains information about the caller: `{
|
135
|
-
page: Page, frame: Frame }`.
|
134
|
+
The first argument of the `callback` function contains information about the caller: `{ browser_context: BrowserContext, page: Page, frame: Frame }`.
|
136
135
|
|
137
136
|
See [Page#expose_binding](./page#expose_binding) for page-only version.
|
138
137
|
|
@@ -193,7 +192,7 @@ If the `callback` returns a [Promise](https://developer.mozilla.org/en-US/docs/W
|
|
193
192
|
|
194
193
|
See [Page#expose_function](./page#expose_function) for page-only version.
|
195
194
|
|
196
|
-
An example of adding
|
195
|
+
An example of adding a `sha256` function to all pages in the context:
|
197
196
|
|
198
197
|
```ruby
|
199
198
|
require 'digest'
|
@@ -8,24 +8,21 @@ sidebar_position: 10
|
|
8
8
|
|
9
9
|
An example of using [Dialog](./dialog) class:
|
10
10
|
|
11
|
-
```
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
with sync_playwright() as playwright:
|
27
|
-
run(playwright)
|
28
|
-
|
11
|
+
```ruby
|
12
|
+
def handle_dialog(dialog)
|
13
|
+
puts "[#{dialog.type}] #{dialog.message}"
|
14
|
+
if dialog.message =~ /foo/
|
15
|
+
dialog.accept_async
|
16
|
+
else
|
17
|
+
dialog.dismiss
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
page.on("dialog", method(:handle_dialog))
|
22
|
+
page.evaluate("confirm('foo')") # will be accepted
|
23
|
+
# => [confirm] foo
|
24
|
+
page.evaluate("alert('bar')") # will be dismissed
|
25
|
+
# => [alert] bar
|
29
26
|
```
|
30
27
|
|
31
28
|
> NOTE: Dialogs are dismissed automatically, unless there is a [`event: Page.dialog`] listener. When listener is
|
@@ -9,21 +9,11 @@ sidebar_position: 10
|
|
9
9
|
ElementHandle represents an in-page DOM element. ElementHandles can be created with the [Page#query_selector](./page#query_selector)
|
10
10
|
method.
|
11
11
|
|
12
|
-
```
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
browser = chromium.launch()
|
18
|
-
page = browser.new_page()
|
19
|
-
page.goto("https://example.com")
|
20
|
-
href_element = page.query_selector("a")
|
21
|
-
href_element.click()
|
22
|
-
# ...
|
23
|
-
|
24
|
-
with sync_playwright() as playwright:
|
25
|
-
run(playwright)
|
26
|
-
|
12
|
+
```ruby
|
13
|
+
page.goto("https://example.com")
|
14
|
+
href_element = page.query_selector("a")
|
15
|
+
href_element.click
|
16
|
+
# ...
|
27
17
|
```
|
28
18
|
|
29
19
|
ElementHandle prevents DOM element from garbage collection unless the handle is disposed with
|
@@ -51,10 +41,12 @@ Elements from child frames return the bounding box relative to the main frame, u
|
|
51
41
|
Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following
|
52
42
|
snippet should click the center of the element.
|
53
43
|
|
54
|
-
```
|
55
|
-
box = element_handle.bounding_box
|
56
|
-
page.mouse.click(
|
57
|
-
|
44
|
+
```ruby
|
45
|
+
box = element_handle.bounding_box
|
46
|
+
page.mouse.click(
|
47
|
+
box["x"] + box["width"] / 2,
|
48
|
+
box["y"] + box["height"] / 2,
|
49
|
+
)
|
58
50
|
```
|
59
51
|
|
60
52
|
|
@@ -156,9 +148,8 @@ The snippet below dispatches the `click` event on the element. Regardless of the
|
|
156
148
|
`click` is dispatched. This is equivalent to calling
|
157
149
|
[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).
|
158
150
|
|
159
|
-
```
|
151
|
+
```ruby
|
160
152
|
element_handle.dispatch_event("click")
|
161
|
-
|
162
153
|
```
|
163
154
|
|
164
155
|
Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties
|
@@ -175,11 +166,10 @@ Since `eventInit` is event-specific, please refer to the events documentation fo
|
|
175
166
|
|
176
167
|
You can also specify [JSHandle](./js_handle) as the property value if you want live objects to be passed into the event:
|
177
168
|
|
178
|
-
```
|
169
|
+
```ruby
|
179
170
|
# note you can only create data_transfer in chromium and firefox
|
180
171
|
data_transfer = page.evaluate_handle("new DataTransfer()")
|
181
|
-
element_handle.dispatch_event("
|
182
|
-
|
172
|
+
element_handle.dispatch_event("dragstart", eventInit: { dataTransfer: data_transfer })
|
183
173
|
```
|
184
174
|
|
185
175
|
|
@@ -201,11 +191,10 @@ and return its value.
|
|
201
191
|
|
202
192
|
Examples:
|
203
193
|
|
204
|
-
```
|
194
|
+
```ruby
|
205
195
|
tweet_handle = page.query_selector(".tweet")
|
206
|
-
|
207
|
-
|
208
|
-
|
196
|
+
tweet_handle.eval_on_selector(".like", "node => node.innerText") # => "100"
|
197
|
+
tweet_handle.eval_on_selector(".retweets", "node => node.innerText") # => "10"
|
209
198
|
```
|
210
199
|
|
211
200
|
|
@@ -233,10 +222,9 @@ Examples:
|
|
233
222
|
</div>
|
234
223
|
```
|
235
224
|
|
236
|
-
```
|
225
|
+
```ruby
|
237
226
|
feed_handle = page.query_selector(".feed")
|
238
|
-
|
239
|
-
|
227
|
+
feed_handle.eval_on_selector_all(".tweet", "nodes => nodes.map(n => n.innerText)") # => ["hello!", "hi!"]
|
240
228
|
```
|
241
229
|
|
242
230
|
|
@@ -463,26 +451,18 @@ Returns the array of option values that have been successfully selected.
|
|
463
451
|
|
464
452
|
Triggers a `change` and `input` event once all the provided options have been selected.
|
465
453
|
|
466
|
-
```
|
454
|
+
```ruby
|
467
455
|
# single selection matching the value
|
468
|
-
|
456
|
+
element_handle.select_option(value: "blue")
|
469
457
|
# single selection matching both the label
|
470
|
-
|
458
|
+
element_handle.select_option(label: "blue")
|
471
459
|
# multiple selection
|
472
|
-
|
473
|
-
|
460
|
+
element_handle.select_option(value: ["red", "green", "blue"])
|
474
461
|
```
|
475
462
|
|
476
|
-
```
|
477
|
-
# single selection matching the value
|
478
|
-
handle.select_option("blue")
|
479
|
-
# single selection matching both the value and the label
|
480
|
-
handle.select_option(label="blue")
|
481
|
-
# multiple selection
|
482
|
-
handle.select_option("red", "green", "blue")
|
463
|
+
```ruby
|
483
464
|
# multiple selection for blue, red and second option
|
484
|
-
|
485
|
-
|
465
|
+
element_handle.select_option(value: "blue", index: 2, label: "red")
|
486
466
|
```
|
487
467
|
|
488
468
|
|
@@ -552,19 +532,17 @@ Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup`
|
|
552
532
|
|
553
533
|
To press a special key, like `Control` or `ArrowDown`, use [ElementHandle#press](./element_handle#press).
|
554
534
|
|
555
|
-
```
|
535
|
+
```ruby
|
556
536
|
element_handle.type("hello") # types instantly
|
557
|
-
element_handle.type("world", delay
|
558
|
-
|
537
|
+
element_handle.type("world", delay: 100) # types slower, like a user
|
559
538
|
```
|
560
539
|
|
561
540
|
An example of typing into a text field and then submitting the form:
|
562
541
|
|
563
|
-
```
|
542
|
+
```ruby
|
564
543
|
element_handle = page.query_selector("input")
|
565
544
|
element_handle.type("some text")
|
566
545
|
element_handle.press("Enter")
|
567
|
-
|
568
546
|
```
|
569
547
|
|
570
548
|
|
@@ -6,12 +6,11 @@ sidebar_position: 10
|
|
6
6
|
|
7
7
|
[FileChooser](./file_chooser) objects are dispatched by the page in the [`event: Page.fileChooser`] event.
|
8
8
|
|
9
|
-
```
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
```ruby
|
10
|
+
file_chooser = page.expect_file_chooser do
|
11
|
+
page.click("upload") # action to trigger file uploading
|
12
|
+
end
|
13
13
|
file_chooser.set_files("myfile.pdf")
|
14
|
-
|
15
14
|
```
|
16
15
|
|
17
16
|
|
@@ -308,9 +308,8 @@ a_window_handle # handle for the window object.
|
|
308
308
|
|
309
309
|
A string can also be passed in instead of a function.
|
310
310
|
|
311
|
-
```
|
311
|
+
```ruby
|
312
312
|
a_handle = page.evaluate_handle("document") # handle for the "document"
|
313
|
-
|
314
313
|
```
|
315
314
|
|
316
315
|
[JSHandle](./js_handle) instances can be passed as an argument to the [Frame#evaluate_handle](./frame#evaluate_handle):
|
@@ -318,8 +317,8 @@ a_handle = page.evaluate_handle("document") # handle for the "document"
|
|
318
317
|
```ruby
|
319
318
|
body_handle = page.evaluate_handle("document.body")
|
320
319
|
result_handle = page.evaluate_handle("body => body.innerHTML", arg: body_handle)
|
321
|
-
puts result_handle.json_value
|
322
|
-
result_handle.dispose
|
320
|
+
puts result_handle.json_value
|
321
|
+
result_handle.dispose
|
323
322
|
```
|
324
323
|
|
325
324
|
|
@@ -7,10 +7,9 @@ sidebar_position: 10
|
|
7
7
|
JSHandle represents an in-page JavaScript object. JSHandles can be created with the [Page#evaluate_handle](./page#evaluate_handle)
|
8
8
|
method.
|
9
9
|
|
10
|
-
```
|
10
|
+
```ruby
|
11
11
|
window_handle = page.evaluate_handle("window")
|
12
12
|
# ...
|
13
|
-
|
14
13
|
```
|
15
14
|
|
16
15
|
JSHandle prevents the referenced JavaScript object being garbage collected unless the handle is exposed with
|
@@ -50,10 +49,9 @@ If `expression` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web
|
|
50
49
|
|
51
50
|
Examples:
|
52
51
|
|
53
|
-
```
|
52
|
+
```ruby
|
54
53
|
tweet_handle = page.query_selector(".tweet .retweets")
|
55
|
-
|
56
|
-
|
54
|
+
tweet_handle.evaluate("node => node.innerText") # => "10 retweets"
|
57
55
|
```
|
58
56
|
|
59
57
|
|
@@ -68,10 +66,10 @@ Returns the return value of `expression` as a [JSHandle](./js_handle).
|
|
68
66
|
|
69
67
|
This method passes this handle as the first argument to `expression`.
|
70
68
|
|
71
|
-
The only difference between
|
69
|
+
The only difference between [JSHandle#evaluate](./js_handle#evaluate) and [JSHandle#evaluate_handle](./js_handle#evaluate_handle) is that [JSHandle#evaluate_handle](./js_handle#evaluate_handle) returns
|
72
70
|
[JSHandle](./js_handle).
|
73
71
|
|
74
|
-
If the function passed to the
|
72
|
+
If the function passed to the [JSHandle#evaluate_handle](./js_handle#evaluate_handle) returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), then [JSHandle#evaluate_handle](./js_handle#evaluate_handle) would wait
|
75
73
|
for the promise to resolve and return its value.
|
76
74
|
|
77
75
|
See [Page#evaluate_handle](./page#evaluate_handle) for more details.
|
@@ -85,13 +83,12 @@ alias: `properties`
|
|
85
83
|
|
86
84
|
The method returns a map with **own property names** as keys and JSHandle instances for the property values.
|
87
85
|
|
88
|
-
```
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
86
|
+
```ruby
|
87
|
+
page.goto('https://example.com/')
|
88
|
+
window_handle = page.evaluate_handle("window")
|
89
|
+
properties = window_handle.properties
|
90
|
+
puts properties
|
91
|
+
window_handle.dispose
|
95
92
|
```
|
96
93
|
|
97
94
|
|
@@ -224,9 +224,9 @@ The snippet below dispatches the `click` event on the element. Regardless of the
|
|
224
224
|
`click` is dispatched. This is equivalent to calling
|
225
225
|
[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).
|
226
226
|
|
227
|
-
```
|
227
|
+
```ruby
|
228
|
+
page.content = '<button id="submit">Send</button>'
|
228
229
|
page.dispatch_event("button#submit", "click")
|
229
|
-
|
230
230
|
```
|
231
231
|
|
232
232
|
Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties
|
@@ -243,11 +243,12 @@ Since `eventInit` is event-specific, please refer to the events documentation fo
|
|
243
243
|
|
244
244
|
You can also specify [JSHandle](./js_handle) as the property value if you want live objects to be passed into the event:
|
245
245
|
|
246
|
-
```
|
246
|
+
```ruby
|
247
|
+
page.content = '<div id="source">Drag</div>'
|
248
|
+
|
247
249
|
# note you can only create data_transfer in chromium and firefox
|
248
250
|
data_transfer = page.evaluate_handle("new DataTransfer()")
|
249
|
-
page.dispatch_event("#source", "dragstart", {
|
250
|
-
|
251
|
+
page.dispatch_event("#source", "dragstart", eventInit: { dataTransfer: data_transfer })
|
251
252
|
```
|
252
253
|
|
253
254
|
|
@@ -255,40 +256,30 @@ page.dispatch_event("#source", "dragstart", { "dataTransfer": data_transfer })
|
|
255
256
|
## emulate_media
|
256
257
|
|
257
258
|
```
|
258
|
-
def emulate_media(colorScheme: nil, media: nil)
|
259
|
+
def emulate_media(colorScheme: nil, media: nil, reducedMotion: nil)
|
259
260
|
```
|
260
261
|
|
261
262
|
This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media
|
262
263
|
feature, using the `colorScheme` argument.
|
263
264
|
|
264
|
-
```
|
265
|
-
page.evaluate("matchMedia('screen').matches")
|
266
|
-
#
|
267
|
-
page.evaluate("matchMedia('print').matches")
|
268
|
-
# → False
|
269
|
-
|
270
|
-
page.emulate_media(media="print")
|
271
|
-
page.evaluate("matchMedia('screen').matches")
|
272
|
-
# → False
|
273
|
-
page.evaluate("matchMedia('print').matches")
|
274
|
-
# → True
|
265
|
+
```ruby
|
266
|
+
page.evaluate("matchMedia('screen').matches") # => true
|
267
|
+
page.evaluate("matchMedia('print').matches") # => false
|
275
268
|
|
276
|
-
page.emulate_media()
|
277
|
-
page.evaluate("matchMedia('screen').matches")
|
278
|
-
#
|
279
|
-
page.evaluate("matchMedia('print').matches")
|
280
|
-
# → False
|
269
|
+
page.emulate_media(media: "print")
|
270
|
+
page.evaluate("matchMedia('screen').matches") # => false
|
271
|
+
page.evaluate("matchMedia('print').matches") # => true
|
281
272
|
|
273
|
+
page.emulate_media
|
274
|
+
page.evaluate("matchMedia('screen').matches") # => true
|
275
|
+
page.evaluate("matchMedia('print').matches") # => false
|
282
276
|
```
|
283
277
|
|
284
|
-
```
|
285
|
-
page.emulate_media(
|
286
|
-
page.evaluate("matchMedia('(prefers-color-scheme: dark)').matches")
|
287
|
-
#
|
288
|
-
page.evaluate("matchMedia('(prefers-color-scheme:
|
289
|
-
# → False
|
290
|
-
page.evaluate("matchMedia('(prefers-color-scheme: no-preference)').matches")
|
291
|
-
|
278
|
+
```ruby
|
279
|
+
page.emulate_media(colorScheme="dark")
|
280
|
+
page.evaluate("matchMedia('(prefers-color-scheme: dark)').matches") # => true
|
281
|
+
page.evaluate("matchMedia('(prefers-color-scheme: light)').matches") # => false
|
282
|
+
page.evaluate("matchMedia('(prefers-color-scheme: no-preference)').matches") # => false
|
292
283
|
```
|
293
284
|
|
294
285
|
|
@@ -370,7 +361,7 @@ puts page.evaluate("1 + #{x}") # => "11"
|
|
370
361
|
```ruby
|
371
362
|
body_handle = page.query_selector("body")
|
372
363
|
html = page.evaluate("([body, suffix]) => body.innerHTML + suffix", arg: [body_handle, "hello"])
|
373
|
-
body_handle.dispose
|
364
|
+
body_handle.dispose
|
374
365
|
```
|
375
366
|
|
376
367
|
Shortcut for main frame's [Frame#evaluate](./frame#evaluate).
|
@@ -389,17 +380,15 @@ The only difference between [Page#evaluate](./page#evaluate) and [Page#evaluate_
|
|
389
380
|
If the function passed to the [Page#evaluate_handle](./page#evaluate_handle) returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), then [Page#evaluate_handle](./page#evaluate_handle)
|
390
381
|
would wait for the promise to resolve and return its value.
|
391
382
|
|
392
|
-
```
|
383
|
+
```ruby
|
393
384
|
a_window_handle = page.evaluate_handle("Promise.resolve(window)")
|
394
385
|
a_window_handle # handle for the window object.
|
395
|
-
|
396
386
|
```
|
397
387
|
|
398
388
|
A string can also be passed in instead of a function:
|
399
389
|
|
400
|
-
```
|
390
|
+
```ruby
|
401
391
|
a_handle = page.evaluate_handle("document") # handle for the "document"
|
402
|
-
|
403
392
|
```
|
404
393
|
|
405
394
|
[JSHandle](./js_handle) instances can be passed as an argument to the [Page#evaluate_handle](./page#evaluate_handle):
|
@@ -407,8 +396,8 @@ a_handle = page.evaluate_handle("document") # handle for the "document"
|
|
407
396
|
```ruby
|
408
397
|
body_handle = page.evaluate_handle("document.body")
|
409
398
|
result_handle = page.evaluate_handle("body => body.innerHTML", arg: body_handle)
|
410
|
-
puts result_handle.json_value
|
411
|
-
result_handle.dispose
|
399
|
+
puts result_handle.json_value
|
400
|
+
result_handle.dispose
|
412
401
|
```
|
413
402
|
|
414
403
|
|
@@ -423,8 +412,7 @@ The method adds a function called `name` on the `window` object of every frame i
|
|
423
412
|
executes `callback` and returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which resolves to the return value of `callback`. If the `callback` returns
|
424
413
|
a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), it will be awaited.
|
425
414
|
|
426
|
-
The first argument of the `callback` function contains information about the caller: `{
|
427
|
-
page: Page, frame: Frame }`.
|
415
|
+
The first argument of the `callback` function contains information about the caller: `{ browser_context: BrowserContext, page: Page, frame: Frame }`.
|
428
416
|
|
429
417
|
See [BrowserContext#expose_binding](./browser_context#expose_binding) for the context-wide version.
|
430
418
|
|
@@ -432,46 +420,39 @@ See [BrowserContext#expose_binding](./browser_context#expose_binding) for the co
|
|
432
420
|
|
433
421
|
An example of exposing page URL to all frames in a page:
|
434
422
|
|
435
|
-
```
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
document.querySelector('div').textContent = await window.pageURL();
|
448
|
-
}
|
449
|
-
</script>
|
450
|
-
<button onclick="onClick()">Click me</button>
|
451
|
-
<div></div>
|
452
|
-
""")
|
453
|
-
page.click("button")
|
454
|
-
|
455
|
-
with sync_playwright() as playwright:
|
456
|
-
run(playwright)
|
457
|
-
|
423
|
+
```ruby
|
424
|
+
page.expose_binding("pageURL", ->(source) { source[:page].url })
|
425
|
+
page.content = <<~HTML
|
426
|
+
<script>
|
427
|
+
async function onClick() {
|
428
|
+
document.querySelector('div').textContent = await window.pageURL();
|
429
|
+
}
|
430
|
+
</script>
|
431
|
+
<button onclick="onClick()">Click me</button>
|
432
|
+
<div></div>
|
433
|
+
HTML
|
434
|
+
page.click("button")
|
458
435
|
```
|
459
436
|
|
460
437
|
An example of passing an element handle:
|
461
438
|
|
462
|
-
```
|
463
|
-
def
|
464
|
-
|
439
|
+
```ruby
|
440
|
+
def print_text(source, element)
|
441
|
+
element.text_content
|
442
|
+
end
|
465
443
|
|
466
|
-
page.expose_binding("clicked",
|
467
|
-
page.
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
444
|
+
page.expose_binding("clicked", method(:print_text), handle: true)
|
445
|
+
page.content = <<~HTML
|
446
|
+
<script>
|
447
|
+
document.addEventListener('click', async (event) => {
|
448
|
+
alert(await window.clicked(event.target));
|
449
|
+
})
|
450
|
+
</script>
|
451
|
+
<div>Click me</div>
|
452
|
+
<div>Or click me</div>
|
453
|
+
HTML
|
474
454
|
|
455
|
+
page.click('div')
|
475
456
|
```
|
476
457
|
|
477
458
|
|
@@ -491,37 +472,26 @@ See [BrowserContext#expose_function](./browser_context#expose_function) for cont
|
|
491
472
|
|
492
473
|
> NOTE: Functions installed via [Page#expose_function](./page#expose_function) survive navigations.
|
493
474
|
|
494
|
-
An example of adding
|
495
|
-
|
496
|
-
```python sync title=example_496ab45e0c5f4c47869f66c2b738fbd9eef0ef4065fa923caf9c929e50e14c21.py
|
497
|
-
import hashlib
|
498
|
-
from playwright.sync_api import sync_playwright
|
475
|
+
An example of adding a `sha256` function to the page:
|
499
476
|
|
500
|
-
|
501
|
-
|
502
|
-
m.update(bytes(text, "utf8"))
|
503
|
-
return m.hexdigest()
|
504
|
-
|
505
|
-
|
506
|
-
def run(playwright):
|
507
|
-
webkit = playwright.webkit
|
508
|
-
browser = webkit.launch(headless=False)
|
509
|
-
page = browser.new_page()
|
510
|
-
page.expose_function("sha1", sha1)
|
511
|
-
page.set_content("""
|
512
|
-
<script>
|
513
|
-
async function onClick() {
|
514
|
-
document.querySelector('div').textContent = await window.sha1('PLAYWRIGHT');
|
515
|
-
}
|
516
|
-
</script>
|
517
|
-
<button onclick="onClick()">Click me</button>
|
518
|
-
<div></div>
|
519
|
-
""")
|
520
|
-
page.click("button")
|
477
|
+
```ruby
|
478
|
+
require 'digest'
|
521
479
|
|
522
|
-
|
523
|
-
|
480
|
+
def sha1(text)
|
481
|
+
Digest::SHA256.hexdigest(text)
|
482
|
+
end
|
524
483
|
|
484
|
+
page.expose_function("sha256", method(:sha256))
|
485
|
+
page.content = <<~HTML
|
486
|
+
<script>
|
487
|
+
async function onClick() {
|
488
|
+
document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');
|
489
|
+
}
|
490
|
+
</script>
|
491
|
+
<button onclick="onClick()">Click me</button>
|
492
|
+
<div></div>
|
493
|
+
HTML
|
494
|
+
page.click("button")
|
525
495
|
```
|
526
496
|
|
527
497
|
|
@@ -564,14 +534,12 @@ def frame(name: nil, url: nil)
|
|
564
534
|
|
565
535
|
Returns frame matching the specified criteria. Either `name` or `url` must be specified.
|
566
536
|
|
567
|
-
```
|
568
|
-
frame = page.frame(name
|
569
|
-
|
537
|
+
```ruby
|
538
|
+
frame = page.frame(name: "frame-name")
|
570
539
|
```
|
571
540
|
|
572
|
-
```
|
573
|
-
frame = page.frame(url
|
574
|
-
|
541
|
+
```ruby
|
542
|
+
frame = page.frame(url: /.*domain.*/)
|
575
543
|
```
|
576
544
|
|
577
545
|
|
@@ -786,11 +754,10 @@ Returns the PDF buffer.
|
|
786
754
|
[`-webkit-print-color-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust) property to
|
787
755
|
force rendering of exact colors.
|
788
756
|
|
789
|
-
```
|
757
|
+
```ruby
|
790
758
|
# generates a pdf with "screen" media type.
|
791
|
-
page.emulate_media(media
|
792
|
-
page.pdf(path
|
793
|
-
|
759
|
+
page.emulate_media(media: "screen")
|
760
|
+
page.pdf(path: "page.pdf")
|
794
761
|
```
|
795
762
|
|
796
763
|
The `width`, `height`, and `margin` options accept values labeled with units. Unlabeled values are treated as pixels.
|
@@ -852,17 +819,14 @@ texts.
|
|
852
819
|
Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported as well. When specified with the
|
853
820
|
modifier, modifier is pressed and being held while the subsequent key is being pressed.
|
854
821
|
|
855
|
-
```
|
856
|
-
page = browser.new_page()
|
822
|
+
```ruby
|
857
823
|
page.goto("https://keycode.info")
|
858
824
|
page.press("body", "A")
|
859
|
-
page.screenshot(path
|
825
|
+
page.screenshot(path: "a.png")
|
860
826
|
page.press("body", "ArrowLeft")
|
861
|
-
page.screenshot(path
|
827
|
+
page.screenshot(path: "arrow_left.png")
|
862
828
|
page.press("body", "Shift+O")
|
863
|
-
page.screenshot(path
|
864
|
-
browser.close()
|
865
|
-
|
829
|
+
page.screenshot(path: "o.png")
|
866
830
|
```
|
867
831
|
|
868
832
|
|
@@ -912,35 +876,31 @@ Once routing is enabled, every request matching the url pattern will stall unles
|
|
912
876
|
|
913
877
|
An example of a naive handler that aborts all image requests:
|
914
878
|
|
915
|
-
```
|
916
|
-
page
|
917
|
-
page.route("**/*.{png,jpg,jpeg}", lambda route: route.abort())
|
879
|
+
```ruby
|
880
|
+
page.route("**/*.{png,jpg,jpeg}", ->(route, request) { route.abort })
|
918
881
|
page.goto("https://example.com")
|
919
|
-
browser.close()
|
920
|
-
|
921
882
|
```
|
922
883
|
|
923
884
|
or the same snippet using a regex pattern instead:
|
924
885
|
|
925
|
-
```
|
926
|
-
page
|
927
|
-
page.route(re.compile(r"(\.png$)|(\.jpg$)"), lambda route: route.abort())
|
886
|
+
```ruby
|
887
|
+
page.route(/\.(png|jpg)$/, ->(route, request) { route.abort })
|
928
888
|
page.goto("https://example.com")
|
929
|
-
browser.close()
|
930
|
-
|
931
889
|
```
|
932
890
|
|
933
891
|
It is possible to examine the request to decide the route action. For example, mocking all requests that contain some
|
934
892
|
post data, and leaving all other requests as is:
|
935
893
|
|
936
|
-
```
|
937
|
-
def handle_route(route)
|
938
|
-
if
|
939
|
-
|
894
|
+
```ruby
|
895
|
+
def handle_route(route, request)
|
896
|
+
if request.post_data["my-string"]
|
897
|
+
mocked_data = request.post_data.merge({ "my-string" => 'mocked-data'})
|
898
|
+
route.fulfill(postData: mocked_data)
|
940
899
|
else
|
941
|
-
route.
|
942
|
-
|
943
|
-
|
900
|
+
route.continue
|
901
|
+
end
|
902
|
+
end
|
903
|
+
page.route("/api/**", method(:handle_route))
|
944
904
|
```
|
945
905
|
|
946
906
|
Page routes take precedence over browser context routes (set up with [BrowserContext#route](./browser_context#route)) when request
|
@@ -989,14 +949,13 @@ Returns the array of option values that have been successfully selected.
|
|
989
949
|
|
990
950
|
Triggers a `change` and `input` event once all the provided options have been selected.
|
991
951
|
|
992
|
-
```
|
952
|
+
```ruby
|
993
953
|
# single selection matching the value
|
994
|
-
page.select_option("select#colors", "blue")
|
954
|
+
page.select_option("select#colors", value: "blue")
|
995
955
|
# single selection matching both the label
|
996
|
-
page.select_option("select#colors", label
|
956
|
+
page.select_option("select#colors", label: "blue")
|
997
957
|
# multiple selection
|
998
|
-
page.select_option("select#colors", value
|
999
|
-
|
958
|
+
page.select_option("select#colors", value: ["red", "green", "blue"])
|
1000
959
|
```
|
1001
960
|
|
1002
961
|
Shortcut for main frame's [Frame#select_option](./frame#select_option).
|
@@ -1076,11 +1035,9 @@ In the case of multiple pages in a single browser, each page can have its own vi
|
|
1076
1035
|
`page.setViewportSize` will resize the page. A lot of websites don't expect phones to change size, so you should set the
|
1077
1036
|
viewport size before navigating to the page.
|
1078
1037
|
|
1079
|
-
```
|
1080
|
-
page =
|
1081
|
-
page.set_viewport_size({"width": 640, "height": 480})
|
1038
|
+
```ruby
|
1039
|
+
page.viewport_size = { width: 640, height: 480 }
|
1082
1040
|
page.goto("https://example.com")
|
1083
|
-
|
1084
1041
|
```
|
1085
1042
|
|
1086
1043
|
|
@@ -1145,10 +1102,9 @@ fine-grained keyboard events. To fill values in form fields, use [Page#fill](./p
|
|
1145
1102
|
|
1146
1103
|
To press a special key, like `Control` or `ArrowDown`, use [Keyboard#press](./keyboard#press).
|
1147
1104
|
|
1148
|
-
```
|
1105
|
+
```ruby
|
1149
1106
|
page.type("#mytextarea", "hello") # types instantly
|
1150
|
-
page.type("#mytextarea", "world", delay
|
1151
|
-
|
1107
|
+
page.type("#mytextarea", "world", delay: 100) # types slower, like a user
|
1152
1108
|
```
|
1153
1109
|
|
1154
1110
|
Shortcut for main frame's [Frame#type](./frame#type).
|
@@ -1221,7 +1177,7 @@ def expect_console_message(predicate: nil, timeout: nil, &block)
|
|
1221
1177
|
|
1222
1178
|
Performs action and waits for a [ConsoleMessage](./console_message) to be logged by in the page. If predicate is provided, it passes
|
1223
1179
|
[ConsoleMessage](./console_message) value into the `predicate` function and waits for `predicate(message)` to return a truthy value. Will
|
1224
|
-
throw an error if the page is closed before the console event is fired.
|
1180
|
+
throw an error if the page is closed before the [`event: Page.console`] event is fired.
|
1225
1181
|
|
1226
1182
|
## expect_download
|
1227
1183
|
|
@@ -1242,15 +1198,13 @@ def expect_event(event, predicate: nil, timeout: nil, &block)
|
|
1242
1198
|
Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy
|
1243
1199
|
value. Will throw an error if the page is closed before the event is fired. Returns the event data value.
|
1244
1200
|
|
1245
|
-
```
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1201
|
+
```ruby
|
1202
|
+
frame = page.expect_event("framenavigated") do
|
1203
|
+
page.click("button")
|
1204
|
+
end
|
1250
1205
|
```
|
1251
1206
|
|
1252
1207
|
|
1253
|
-
|
1254
1208
|
## expect_file_chooser
|
1255
1209
|
|
1256
1210
|
```
|
@@ -1258,7 +1212,7 @@ def expect_file_chooser(predicate: nil, timeout: nil, &block)
|
|
1258
1212
|
```
|
1259
1213
|
|
1260
1214
|
Performs action and waits for a new [FileChooser](./file_chooser) to be created. If predicate is provided, it passes [FileChooser](./file_chooser) value
|
1261
|
-
into the `predicate` function and waits for `predicate(fileChooser)` to return a truthy value. Will throw an error if
|
1215
|
+
into the `predicate` function and waits for `predicate.call(fileChooser)` to return a truthy value. Will throw an error if
|
1262
1216
|
the page is closed before the file chooser is opened.
|
1263
1217
|
|
1264
1218
|
## wait_for_function
|
@@ -1271,28 +1225,16 @@ Returns when the `expression` returns a truthy value. It resolves to a JSHandle
|
|
1271
1225
|
|
1272
1226
|
The [Page#wait_for_function](./page#wait_for_function) can be used to observe viewport size change:
|
1273
1227
|
|
1274
|
-
```
|
1275
|
-
|
1276
|
-
|
1277
|
-
def run(playwright):
|
1278
|
-
webkit = playwright.webkit
|
1279
|
-
browser = webkit.launch()
|
1280
|
-
page = browser.new_page()
|
1281
|
-
page.evaluate("window.x = 0; setTimeout(() => { window.x = 100 }, 1000);")
|
1282
|
-
page.wait_for_function("() => window.x > 0")
|
1283
|
-
browser.close()
|
1284
|
-
|
1285
|
-
with sync_playwright() as playwright:
|
1286
|
-
run(playwright)
|
1287
|
-
|
1228
|
+
```ruby
|
1229
|
+
page.evaluate("window.x = 0; setTimeout(() => { window.x = 100 }, 1000);")
|
1230
|
+
page.wait_for_function("() => window.x > 0")
|
1288
1231
|
```
|
1289
1232
|
|
1290
1233
|
To pass an argument to the predicate of [Page#wait_for_function](./page#wait_for_function) function:
|
1291
1234
|
|
1292
|
-
```
|
1235
|
+
```ruby
|
1293
1236
|
selector = ".foo"
|
1294
|
-
page.wait_for_function("selector => !!document.querySelector(selector)", selector)
|
1295
|
-
|
1237
|
+
page.wait_for_function("selector => !!document.querySelector(selector)", arg: selector)
|
1296
1238
|
```
|
1297
1239
|
|
1298
1240
|
Shortcut for main frame's [Frame#wait_for_function](./frame#wait_for_function).
|
@@ -1308,20 +1250,19 @@ Returns when the required load state has been reached.
|
|
1308
1250
|
This resolves when the page reaches a required load state, `load` by default. The navigation must have been committed
|
1309
1251
|
when this method is called. If current document has already reached the required state, resolves immediately.
|
1310
1252
|
|
1311
|
-
```
|
1253
|
+
```ruby
|
1312
1254
|
page.click("button") # click triggers navigation.
|
1313
|
-
page.wait_for_load_state
|
1314
|
-
|
1255
|
+
page.wait_for_load_state # the promise resolves after "load" event.
|
1315
1256
|
```
|
1316
1257
|
|
1317
|
-
```
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
# Following resolves after "domcontentloaded" event.
|
1322
|
-
popup.wait_for_load_state("domcontentloaded")
|
1323
|
-
print(popup.title()) # popup is ready to use.
|
1258
|
+
```ruby
|
1259
|
+
popup = page.expect_popup do
|
1260
|
+
page.click("button") # click triggers a popup.
|
1261
|
+
end
|
1324
1262
|
|
1263
|
+
# Following resolves after "domcontentloaded" event.
|
1264
|
+
popup.wait_for_load_state("domcontentloaded")
|
1265
|
+
puts popup.title # popup is ready to use.
|
1325
1266
|
```
|
1326
1267
|
|
1327
1268
|
Shortcut for main frame's [Frame#wait_for_load_state](./frame#wait_for_load_state).
|
@@ -1340,17 +1281,16 @@ This resolves when the page navigates to a new URL or reloads. It is useful for
|
|
1340
1281
|
cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`.
|
1341
1282
|
Consider this example:
|
1342
1283
|
|
1343
|
-
```
|
1344
|
-
|
1345
|
-
|
1346
|
-
# Resolves after navigation has finished
|
1347
|
-
|
1284
|
+
```ruby
|
1285
|
+
page.expect_navigation do
|
1286
|
+
page.click("a.delayed-navigation") # clicking the link will indirectly cause a navigation
|
1287
|
+
end # Resolves after navigation has finished
|
1348
1288
|
```
|
1349
1289
|
|
1350
1290
|
> NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is
|
1351
1291
|
considered a navigation.
|
1352
1292
|
|
1353
|
-
Shortcut for main frame's [
|
1293
|
+
Shortcut for main frame's [Frame#expect_navigation](./frame#expect_navigation).
|
1354
1294
|
|
1355
1295
|
## expect_popup
|
1356
1296
|
|
@@ -1358,29 +1298,32 @@ Shortcut for main frame's [`method: Frame.waitForNavigation`].
|
|
1358
1298
|
def expect_popup(predicate: nil, timeout: nil, &block)
|
1359
1299
|
```
|
1360
1300
|
|
1361
|
-
Performs action and waits for a popup [Page](./page). If predicate is provided, it passes [
|
1362
|
-
function and waits for `predicate(page)` to return a truthy value. Will throw an error if the page is closed before the
|
1363
|
-
popup event is fired.
|
1301
|
+
Performs action and waits for a popup [Page](./page). If predicate is provided, it passes popup [Page](./page) value into the predicate function and waits for `predicate.call(page)` to return a truthy value. Will throw an error if the page is closed before the popup event is fired.
|
1364
1302
|
|
1365
1303
|
## expect_request
|
1366
1304
|
|
1367
1305
|
```
|
1368
|
-
def expect_request(urlOrPredicate, timeout: nil)
|
1306
|
+
def expect_request(urlOrPredicate, timeout: nil, &block)
|
1369
1307
|
```
|
1370
1308
|
|
1371
1309
|
Waits for the matching request and returns it. See [waiting for event](https://playwright.dev/python/docs/events) for more details
|
1372
1310
|
about events.
|
1373
1311
|
|
1374
|
-
```
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1312
|
+
```ruby
|
1313
|
+
page.content = '<form action="https://example.com/resource"><input type="submit" /></form>'
|
1314
|
+
request = page.expect_request(/example.com\/resource/) do
|
1315
|
+
page.click("input")
|
1316
|
+
end
|
1317
|
+
puts request.headers
|
1378
1318
|
|
1379
|
-
#
|
1380
|
-
with page.expect_request(lambda request: request.url == "http://example.com" and request.method == "get") as second:
|
1381
|
-
page.click('img')
|
1382
|
-
second_request = second.value
|
1319
|
+
page.wait_for_load_state # wait for request finished.
|
1383
1320
|
|
1321
|
+
# or with a predicate
|
1322
|
+
page.content = '<form action="https://example.com/resource"><input type="submit" /></form>'
|
1323
|
+
request = page.expect_request(->(req) { req.url.start_with? 'https://example.com/resource' }) do
|
1324
|
+
page.click("input")
|
1325
|
+
end
|
1326
|
+
puts request.headers
|
1384
1327
|
```
|
1385
1328
|
|
1386
1329
|
|
@@ -1388,23 +1331,24 @@ second_request = second.value
|
|
1388
1331
|
## expect_response
|
1389
1332
|
|
1390
1333
|
```
|
1391
|
-
def expect_response(urlOrPredicate, timeout: nil)
|
1334
|
+
def expect_response(urlOrPredicate, timeout: nil, &block)
|
1392
1335
|
```
|
1393
1336
|
|
1394
1337
|
Returns the matched response. See [waiting for event](https://playwright.dev/python/docs/events) for more details about events.
|
1395
1338
|
|
1396
|
-
```
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
# or with a lambda
|
1403
|
-
with page.expect_response(lambda response: response.url == "https://example.com" and response.status === 200) as response_info:
|
1404
|
-
page.click("input")
|
1405
|
-
response = response_info.value
|
1406
|
-
return response.ok
|
1339
|
+
```ruby
|
1340
|
+
page.content = '<form action="https://example.com/resource"><input type="submit" /></form>'
|
1341
|
+
response = page.expect_response(/example.com\/resource/) do
|
1342
|
+
page.click("input")
|
1343
|
+
end
|
1344
|
+
puts response.body
|
1407
1345
|
|
1346
|
+
# or with a predicate
|
1347
|
+
page.content = '<form action="https://example.com/resource"><input type="submit" /></form>'
|
1348
|
+
response = page.expect_response(->(res) { res.url.start_with? 'https://example.com/resource' }) do
|
1349
|
+
page.click("input")
|
1350
|
+
end
|
1351
|
+
puts response.body
|
1408
1352
|
```
|
1409
1353
|
|
1410
1354
|
|
@@ -1424,22 +1368,12 @@ selector doesn't satisfy the condition for the `timeout` milliseconds, the funct
|
|
1424
1368
|
|
1425
1369
|
This method works across navigations:
|
1426
1370
|
|
1427
|
-
```
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
page = browser.new_page()
|
1434
|
-
for current_url in ["https://google.com", "https://bbc.com"]:
|
1435
|
-
page.goto(current_url, wait_until="domcontentloaded")
|
1436
|
-
element = page.wait_for_selector("img")
|
1437
|
-
print("Loaded image: " + str(element.get_attribute("src")))
|
1438
|
-
browser.close()
|
1439
|
-
|
1440
|
-
with sync_playwright() as playwright:
|
1441
|
-
run(playwright)
|
1442
|
-
|
1371
|
+
```ruby
|
1372
|
+
%w[https://google.com https://bbc.com].each do |current_url|
|
1373
|
+
page.goto(current_url, waitUntil: "domcontentloaded")
|
1374
|
+
element = page.wait_for_selector("img")
|
1375
|
+
puts "Loaded image: #{element["src"]}"
|
1376
|
+
end
|
1443
1377
|
```
|
1444
1378
|
|
1445
1379
|
|
@@ -1452,10 +1386,9 @@ def wait_for_url(url, timeout: nil, waitUntil: nil)
|
|
1452
1386
|
|
1453
1387
|
Waits for the main frame to navigate to the given URL.
|
1454
1388
|
|
1455
|
-
```
|
1389
|
+
```ruby
|
1456
1390
|
page.click("a.delayed-navigation") # clicking the link will indirectly cause a navigation
|
1457
1391
|
page.wait_for_url("**/target.html")
|
1458
|
-
|
1459
1392
|
```
|
1460
1393
|
|
1461
1394
|
Shortcut for main frame's [Frame#wait_for_url](./frame#wait_for_url).
|