Skip to content

Commit c9f108c

Browse files
committed
Merge branch 'main' into pre/beta
2 parents 78d5eaf + 4740c58 commit c9f108c

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

scrapegraph-py/CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2+
## [1.5.0](https://github.com/ScrapeGraphAI/scrapegraph-sdk/compare/v1.4.3...v1.5.0) (2024-12-04)
3+
4+
5+
### Features
6+
7+
* splitted files ([2791691](https://github.com/ScrapeGraphAI/scrapegraph-sdk/commit/2791691a9381063cc38ac4f4fe7c884166c93116))
8+
9+
## [1.4.3](https://github.com/ScrapeGraphAI/scrapegraph-sdk/compare/v1.4.2...v1.4.3) (2024-12-03)
10+
111
## [1.4.3-beta.3](https://github.com/ScrapeGraphAI/scrapegraph-sdk/compare/v1.4.3-beta.2...v1.4.3-beta.3) (2024-12-05)
212

313

@@ -12,6 +22,20 @@
1222

1323
* logger working properly now ([9712d4c](https://github.com/ScrapeGraphAI/scrapegraph-sdk/commit/9712d4c39eea860f813e86a5e2ffc14db6d3a655))
1424

25+
### Bug Fixes
26+
27+
* updated comment ([8250818](https://github.com/ScrapeGraphAI/scrapegraph-sdk/commit/825081883940bc1caa37f4f13e10f710770aeb9c))
28+
29+
30+
### chore
31+
32+
* improved url validation ([83eac53](https://github.com/ScrapeGraphAI/scrapegraph-sdk/commit/83eac530269a767e5469c4aded1656fe00a2cdc0))
33+
34+
35+
### CI
36+
37+
* **release:** 1.4.3-beta.1 [skip ci] ([cd1169b](https://github.com/ScrapeGraphAI/scrapegraph-sdk/commit/cd1169b584ffa621d99961e2e95db96a28037e13))
38+
1539
## [1.4.3-beta.1](https://github.com/ScrapeGraphAI/scrapegraph-sdk/compare/v1.4.2...v1.4.3-beta.1) (2024-12-03)
1640

1741

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import asyncio
2+
3+
from pydantic import BaseModel, Field
4+
5+
from scrapegraph_py import AsyncClient
6+
7+
8+
# Define a Pydantic model for the output schema
9+
class WebpageSchema(BaseModel):
10+
title: str = Field(description="The title of the webpage")
11+
description: str = Field(description="The description of the webpage")
12+
summary: str = Field(description="A brief summary of the webpage")
13+
14+
15+
async def main():
16+
# Initialize the async client
17+
sgai_client = AsyncClient(api_key="your-api-key-here")
18+
19+
# SmartScraper request with output schema
20+
response = await sgai_client.smartscraper(
21+
website_url="https://example.com",
22+
user_prompt="Extract webpage information",
23+
output_schema=WebpageSchema,
24+
)
25+
26+
# Print the response
27+
print(f"Request ID: {response['request_id']}")
28+
print(f"Result: {response['result']}")
29+
30+
await sgai_client.close()
31+
32+
33+
if __name__ == "__main__":
34+
asyncio.run(main())
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from scrapegraph_py import Client
2+
from scrapegraph_py.logger import sgai_logger
3+
4+
sgai_logger.set_level("DEBUG")
5+
6+
# Initialize the client
7+
sgai_client = Client(api_key="your-api-key-here")
8+
9+
# Check remaining credits
10+
credits = sgai_client.get_credits()
11+
print(f"Credits Info: {credits}")
12+
13+
sgai_client.close()

0 commit comments

Comments
 (0)