mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: basic readme (#403)
This commit is contained in:
parent
2a2ba713ed
commit
f1b825e6a2
38
README.md
38
README.md
@ -1,5 +1,41 @@
|
|||||||
|
# Playwright
|
||||||
|
|
||||||
# Contributing
|
[](https://badge.fury.io/js/playwright)
|
||||||
|
|
||||||
|
Playwright is a Node library to automate web browsers (Chromium, Webkit and Firefox).
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
```
|
||||||
|
npm i playwright
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
Playwright can be used to create a browser instance, open pages, and then manipulate them. See [API docs](https://github.com/microsoft/playwright/blob/master/docs/api.md) for a comprehensive list.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
This code snippet navigates to example.com in the Webkit browser, and saves a screenshot.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const pw = require('playwright');
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const browser = await pw.playwright('webkit').launch(); // or 'chromium', 'firefox'
|
||||||
|
const context = await browser.newContext();
|
||||||
|
const page = await context.newPage();
|
||||||
|
|
||||||
|
await page.goto('https://www.example.com/');
|
||||||
|
await page.screenshot({ path: 'example.png' });
|
||||||
|
|
||||||
|
await browser.close();
|
||||||
|
})();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
||||||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "playwright",
|
"name": "playwright",
|
||||||
"version": "0.9.9-post",
|
"version": "0.9.9-post",
|
||||||
"description": "A high-level API to control web browsers",
|
"description": "A high-level API to automate web browsers",
|
||||||
"repository": "github:Microsoft/playwright",
|
"repository": "github:Microsoft/playwright",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.17.0"
|
"node": ">=10.17.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user