1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { fetch } from "https://esm.town/v/std/fetch";
import process from "node:process";
export const browserlessScrapeExample = (async () => {
const res = await fetch(
`https://chrome.browserless.io/screenshot?token=${process.env.browserlessKey}`,
{
method: "POST",
body: JSON.stringify({
"url": "https://jessmartin-htmlHandler.express.val.run",
"options": {
"clip": {
"x": 0,
"y": 0,
"width": 480,
"height": 800,
},
},
}),
},
);
if (!res.ok) {
return "problem";
}
else {
const data = res.blob();
return data;
}
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023