Update playwright/README.md
This commit is contained in:
@@ -17,8 +17,7 @@ def Page():
|
|||||||
(context := sync_playwright().start().firefox.launch().new_context()).set_default_timeout(0)
|
(context := sync_playwright().start().firefox.launch().new_context()).set_default_timeout(0)
|
||||||
for attr in dir(page := context.new_page()):
|
for attr in dir(page := context.new_page()):
|
||||||
if attr[0] != '_' and callable(method := getattr(page, attr)): setattr(page, attr, sync(method))
|
if attr[0] != '_' and callable(method := getattr(page, attr)): setattr(page, attr, sync(method))
|
||||||
page._repr_png_ = page.screenshot
|
page._repr_png_ = page.screenshot; return page
|
||||||
return page
|
|
||||||
(page := Page()).goto('https://example.org')
|
(page := Page()).goto('https://example.org')
|
||||||
print(page.title()) # Example Domain
|
print(page.title()) # Example Domain
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user