mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: fix python snippet
This commit is contained in:
parent
8a5c93436d
commit
3a898c285e
@ -3634,13 +3634,13 @@ Response response = page.waitForResponse(response -> "https://example.com".equal
|
|||||||
```python async
|
```python async
|
||||||
async with page.expect_response("https://example.com/resource") as response_info:
|
async with page.expect_response("https://example.com/resource") as response_info:
|
||||||
await page.click("input")
|
await page.click("input")
|
||||||
response = response_info.value
|
response = await response_info.value
|
||||||
return response.ok
|
return response.ok
|
||||||
|
|
||||||
# or with a lambda
|
# or with a lambda
|
||||||
async with page.expect_response(lambda response: response.url == "https://example.com" and response.status == 200) as response_info:
|
async with page.expect_response(lambda response: response.url == "https://example.com" and response.status == 200) as response_info:
|
||||||
await page.click("input")
|
await page.click("input")
|
||||||
response = response_info.value
|
response = await response_info.value
|
||||||
return response.ok
|
return response.ok
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user