docs: add sandbox variables explanation to Examples
This commit is contained in:
@@ -64,6 +64,8 @@ console.log({ title, url: page.url() });
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
Variables in scope: `page`, `context`, `state` (persists between calls), `require`, and Node.js globals.
|
||||||
|
|
||||||
**Persist data in state:**
|
**Persist data in state:**
|
||||||
```bash
|
```bash
|
||||||
playwriter -e "state.users = await page.$$eval('.user', els => els.map(e => e.textContent))"
|
playwriter -e "state.users = await page.$$eval('.user', els => els.map(e => e.textContent))"
|
||||||
|
|||||||
Reference in New Issue
Block a user