mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-05 19:04:43 +03:00
docs: updated documentation URLs to use Playwright Homepage (#23250)
This commit is contained in:
parent
76b4b9dbaf
commit
f9521a01ce
@ -91,13 +91,13 @@ To learn how to run these Playwright Test examples, check out our [getting start
|
||||
|
||||
#### Page screenshot
|
||||
|
||||
This code snippet navigates to whatsmyuseragent.org and saves a screenshot.
|
||||
This code snippet navigates to Playwright homepage and saves a screenshot.
|
||||
|
||||
```TypeScript
|
||||
import { test } from '@playwright/test';
|
||||
|
||||
test('Page Screenshot', async ({ page }) => {
|
||||
await page.goto('http://whatsmyuseragent.org/');
|
||||
await page.goto('https://playwright.dev/');
|
||||
await page.screenshot({ path: `example.png` });
|
||||
});
|
||||
```
|
||||
|
@ -283,7 +283,7 @@ Terminates this instance of Playwright in case it was created bypassing the Pyth
|
||||
|
||||
>>> browser = playwright.chromium.launch()
|
||||
>>> page = browser.new_page()
|
||||
>>> page.goto("http://whatsmyuseragent.org/")
|
||||
>>> page.goto("https://playwright.dev/")
|
||||
>>> page.screenshot(path="example.png")
|
||||
>>> browser.close()
|
||||
|
||||
|
@ -90,7 +90,7 @@ Running it downloads the Playwright package and installs browser binaries for Ch
|
||||
|
||||
## First script
|
||||
|
||||
In our first script, we will navigate to `whatsmyuseragent.org` and take a screenshot in WebKit.
|
||||
In our first script, we will navigate to `playwright.dev` and take a screenshot in WebKit.
|
||||
|
||||
```java
|
||||
package org.example;
|
||||
@ -103,7 +103,7 @@ public class App {
|
||||
try (Playwright playwright = Playwright.create()) {
|
||||
Browser browser = playwright.webkit().launch();
|
||||
Page page = browser.newPage();
|
||||
page.navigate("http://whatsmyuseragent.org/");
|
||||
page.navigate("https://playwright.dev/");
|
||||
page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("example.png")));
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ Playwright APIs are asynchronous and return Promise objects. Our code examples u
|
||||
|
||||
## First script
|
||||
|
||||
In our first script, we will navigate to `whatsmyuseragent.org` and take a screenshot in WebKit.
|
||||
In our first script, we will navigate to `https://playwright.dev/` and take a screenshot in WebKit.
|
||||
|
||||
```js
|
||||
const { webkit } = require('playwright');
|
||||
@ -157,7 +157,7 @@ const { webkit } = require('playwright');
|
||||
(async () => {
|
||||
const browser = await webkit.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.goto('http://whatsmyuseragent.org/');
|
||||
await page.goto('https://playwright.dev/');
|
||||
await page.screenshot({ path: `example.png` });
|
||||
await browser.close();
|
||||
})();
|
||||
|
@ -62,7 +62,7 @@ asyncio.run(main())
|
||||
|
||||
## First script
|
||||
|
||||
In our first script, we will navigate to `whatsmyuseragent.org` and take a screenshot in WebKit.
|
||||
In our first script, we will navigate to `https://playwright.dev/` and take a screenshot in WebKit.
|
||||
|
||||
```py
|
||||
from playwright.sync_api import sync_playwright
|
||||
@ -70,7 +70,7 @@ from playwright.sync_api import sync_playwright
|
||||
with sync_playwright() as p:
|
||||
browser = p.webkit.launch()
|
||||
page = browser.new_page()
|
||||
page.goto("http://whatsmyuseragent.org/")
|
||||
page.goto("https://playwright.dev/")
|
||||
page.screenshot(path="example.png")
|
||||
browser.close()
|
||||
```
|
||||
@ -98,7 +98,7 @@ and then launch Playwright within it for quick experimentation:
|
||||
# Pass headless=False to launch() to see the browser UI
|
||||
>>> browser = playwright.chromium.launch()
|
||||
>>> page = browser.new_page()
|
||||
>>> page.goto("http://whatsmyuseragent.org/")
|
||||
>>> page.goto("https://playwright.dev/")
|
||||
>>> page.screenshot(path="example.png")
|
||||
>>> browser.close()
|
||||
>>> playwright.stop()
|
||||
@ -115,7 +115,7 @@ python -m asyncio
|
||||
>>> playwright = await async_playwright().start()
|
||||
>>> browser = await playwright.chromium.launch()
|
||||
>>> page = await browser.new_page()
|
||||
>>> await page.goto("http://whatsmyuseragent.org/")
|
||||
>>> await page.goto("https://playwright.dev/")
|
||||
>>> await page.screenshot(path="example.png")
|
||||
>>> await browser.close()
|
||||
>>> await playwright.stop()
|
||||
@ -131,7 +131,7 @@ from playwright.sync_api import sync_playwright
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch()
|
||||
page = browser.new_page()
|
||||
page.goto("http://whatsmyuseragent.org/")
|
||||
page.goto("https://playwright.dev/")
|
||||
page.screenshot(path="example.png")
|
||||
browser.close()
|
||||
```
|
||||
|
@ -60,7 +60,7 @@ const puppeteer = require('puppeteer');
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.setViewport({ width: 1280, height: 800 });
|
||||
await page.goto('http://whatsmyuseragent.org/', {
|
||||
await page.goto('https://playwright.dev/', {
|
||||
waitUntil: 'networkidle2',
|
||||
});
|
||||
await page.screenshot({ path: 'example.png' });
|
||||
@ -77,7 +77,7 @@ const { chromium } = require('playwright'); // 1
|
||||
const browser = await chromium.launch();
|
||||
const page = await browser.newPage(); // 2
|
||||
await page.setViewportSize({ width: 1280, height: 800 }); // 3
|
||||
await page.goto('http://whatsmyuseragent.org/', {
|
||||
await page.goto('https://playwright.dev/', {
|
||||
waitUntil: 'networkidle', // 4
|
||||
});
|
||||
await page.screenshot({ path: 'example.png' });
|
||||
|
@ -37,7 +37,7 @@ public class PlaywrightThread extends Thread {
|
||||
BrowserType browserType = getBrowserType(playwright, browserName);
|
||||
Browser browser = browserType.launch();
|
||||
Page page = browser.newPage();
|
||||
page.navigate("http://whatsmyuseragent.org/");
|
||||
page.navigate("https://playwright.dev/");
|
||||
page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("user-agent-" + browserName + ".png")));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user