update faqs

This commit is contained in:
Arjun Attam 2020-01-24 10:10:41 -08:00 committed by GitHub
parent 9861cb99c9
commit 3bf52d0ce7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ Playwright can be used to create a browser instance, open pages, and then manipu
#### Page screenshot
This code snippet navigates to thismachine.info in Chromium, Firefox and WebKit, and saves 3 screenshots.
This code snippet navigates to whatsmyuseragent.org in Chromium, Firefox and WebKit, and saves 3 screenshots.
```js
const pw = require('playwright');
@ -47,7 +47,7 @@ const pw = require('playwright');
browsers.forEach(async browserName => {
const browser = await pw[browserName].launch();
const context = await browser.newContext();
const page = await context.newPage('http://thismachine.info/');
const page = await context.newPage('http://whatsmyuseragent.org/');
await page.screenshot({ path: `example-${browserName}.png` });
await browser.close();
@ -135,6 +135,10 @@ Check out our [contributing guide](https://github.com/microsoft/playwright/blob/
## FAQ
**Q: Can I use a single API to automate different browsers?**
Yes, you can. See [Browser](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browser) in the API reference for the common set of APIs across Chromium, Firefox and WebKit. A small set of features are specific to browsers, for example see [ChromiumBrowser](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-chromiumbrowser).
**Q: How does Playwright relate to [Puppeteer](https://github.com/puppeteer/puppeteer)?**
Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer project is active and is maintained by Google.