Skip to content

Commit 628e823

Browse files
committed
add screenshot API example doc and refactor its directory
1 parent ff9df4f commit 628e823

16 files changed

+42
-8
lines changed

examples/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ node examples/basic-get.js
1111
Or compile `.ts` examples to `.js`:
1212

1313
```
14-
tsc examples/basic-get.ts -o examples/basic-get.js
15-
node examples/basic-get.js
14+
tsc examples/scrape/basic-get.ts -o examples/basic-get.js
15+
node examples/scrape/basic-get.js
1616
```
1717

1818
Or run typescript directly through runtimes like `.ts`:
1919

2020
```
21-
bun examples/basic-get.ts
21+
bun examples/scrape/basic-get.ts
2222
```

examples/get-account.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { ScrapflyClient, ScrapeConfig } from '../build/src/main.js';
2-
import { BadApiKeyError } from '../build/src/errors.js';
1+
import { ScrapflyClient, ScrapeConfig } from 'scrapfly-sdk';
32

43
const key = 'YOUR SCRAPFLY KEY';
54
const client = new ScrapflyClient({ key });
@@ -11,4 +10,5 @@ const result = await client.scrape(
1110
url: 'https://httpbin.dev/html',
1211
}),
1312
);
13+
1414
console.log(result);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
This example shows how to set custom headers in scrapfly requests
33
*/
4-
import { ScrapflyClient, ScrapeConfig } from '../build/src/main.js';
4+
import { ScrapflyClient, ScrapeConfig } from 'scrapfly-sdk';
55

66
const key = 'YOUR SCRAPFLY KEY';
77
const client = new ScrapflyClient({ key });
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
This example shows how to POST a form using scrapfly
33
*/
4-
import { ScrapflyClient, ScrapeConfig } from '../build/src/main.js';
4+
import { ScrapflyClient, ScrapeConfig } from 'scrapfly-sdk';
55

66
const key = 'YOUR SCRAPFLY KEY';
77
const client = new ScrapflyClient({ key });
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
This example shows how to POST JSON using scrapfly
33
*/
4-
import { ScrapflyClient, ScrapeConfig } from '../build/src/main.js';
4+
import { ScrapflyClient, ScrapeConfig } from 'scrapfly-sdk';
55

66
const key = 'YOUR SCRAPFLY KEY';
77
const client = new ScrapflyClient({ key });

0 commit comments

Comments
 (0)