Update playwright/README.md

This commit is contained in:
2024-12-24 07:09:19 +00:00
parent eb221c7968
commit 1bcf79b724

View File

@@ -17,8 +17,7 @@ def Page():
(context := sync_playwright().start().firefox.launch().new_context()).set_default_timeout(0)
for attr in dir(page := context.new_page()):
if attr[0] != '_' and callable(method := getattr(page, attr)): setattr(page, attr, sync(method))
page._repr_png_ = page.screenshot
return page
page._repr_png_ = page.screenshot; return page
(page := Page()).goto('https://example.org')
print(page.title()) # Example Domain
```