Uses 65776K of libraries. Click here for Pure Java version (7918L/40K).
1 | !7 |
2 | |
3 | !include once #1032300 // Playwright |
4 | |
5 | cm TestPlaywright > DynSingleFunctionWithPrintLog { |
6 | switchable S url = "https://gaz.ai"; |
7 | switchable double secondsBeforeScreenshot; |
8 | |
9 | void doIt { |
10 | fixContextClassLoader(); |
11 | temp Playwright playwright = Playwright.create(); |
12 | print("Using Chromium"); |
13 | Browser browser = playwright.chromium().launch(); |
14 | print("Virtual browser started"); |
15 | Page page = browser.newPage(); |
16 | page.navigate(url); |
17 | print("Page title for " + url + ": " + page.title()); |
18 | |
19 | print("Sleeping for " + secondsBeforeScreenshot); |
20 | sleepSeconds(secondsBeforeScreenshot); |
21 | print("Trying to get a screenshot"); |
22 | byte[] buffer = page.screenshot(); |
23 | BufferedImage img = imageFromBytes(buffer); |
24 | dm_showImage(url, img); |
25 | } |
26 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1032268 |
Snippet name: | Test Playwright (cross-browser web automation library, OK!) |
Eternal ID of this version: | #1032268/10 |
Text MD5: | 9495d77e32e36c8beb21dd9d82ae3bb4 |
Transpilation MD5: | 8abdc29f81b09bab8befdb12e311a562 |
Author: | stefan |
Category: | javax / networking |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-08-27 01:59:09 |
Source code size: | 804 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 156 / 552 |
Version history: | 9 change(s) |
Referenced in: | [show references] |