Skip to content

Commit 6cac2b4

Browse files
committed
docs: add v2 scrape snippet to transition guide
Add concrete Python and JavaScript v2 code examples for the markdownify-to-scrape migration step. Made-with: Cursor
1 parent 72e2cd6 commit 6cac2b4

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

transition-from-v1-to-v2.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,33 @@ Use this table to map old entry points to new ones. Details and examples follow
3232

3333
**After:** `scrape(url, format="markdown")` (Python) or `scrape(url, { format: "markdown" })` (JS).
3434

35+
<CodeGroup>
36+
37+
```python Python (v2)
38+
from scrapegraph_py import Client
39+
40+
client = Client(api_key="your-api-key")
41+
response = client.scrape(
42+
"https://example.com",
43+
format="markdown",
44+
)
45+
46+
print(response)
47+
```
48+
49+
```javascript JavaScript (v2)
50+
import { scrapegraphai } from "scrapegraph-js";
51+
52+
const sgai = scrapegraphai({ apiKey });
53+
const { data, requestId } = await sgai.scrape("https://example.com", {
54+
format: "markdown",
55+
});
56+
57+
console.log(data);
58+
```
59+
60+
</CodeGroup>
61+
3562
### 2. SmartScraper → `extract`
3663

3764
**Before (v1):** `website_url` + `user_prompt`, optional flags on the same object.

0 commit comments

Comments
 (0)