File tree 4 files changed +71
-0
lines changed
4 files changed +71
-0
lines changed Original file line number Diff line number Diff line change
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
+
1
11
## [ 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)
2
12
3
13
12
22
13
23
* logger working properly now ([ 9712d4c] ( https://github.com/ScrapeGraphAI/scrapegraph-sdk/commit/9712d4c39eea860f813e86a5e2ffc14db6d3a655 ) )
14
24
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
+
15
39
## [ 1.4.3-beta.1] ( https://github.com/ScrapeGraphAI/scrapegraph-sdk/compare/v1.4.2...v1.4.3-beta.1 ) (2024-12-03)
16
40
17
41
Original file line number Diff line number Diff line change
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 ())
File renamed without changes.
Original file line number Diff line number Diff line change
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 ()
You can’t perform that action at this time.
0 commit comments