@@ -53,15 +53,15 @@ from scrapegraph_py.logger import get_logger
5353logger = get_logger(level = " DEBUG" )
5454
5555# Initialize client
56- client = SyncClient(api_key = " sgai- your-api-key" )
56+ sgai_client = SyncClient(api_key = " your-api-key-here " )
5757
5858# Make a request
59- response = client .smartscraper(
59+ response = sgai_client .smartscraper(
6060 website_url = " https://example.com" ,
6161 user_prompt = " Extract the main heading and description"
6262)
6363
64- print (response)
64+ print (response[ " result " ] )
6565```
6666
6767## 🎯 Examples
@@ -73,12 +73,12 @@ import asyncio
7373from scrapegraph_py import AsyncClient
7474
7575async def main ():
76- async with AsyncClient(api_key = " sgai- your-api-key" ) as client :
77- response = await client .smartscraper(
76+ async with AsyncClient(api_key = " your-api-key-here " ) as sgai_client :
77+ response = await sgai_client .smartscraper(
7878 website_url = " https://example.com" ,
79- user_prompt = " Extract the main heading "
79+ user_prompt = " Summarize the main content "
8080 )
81- print (response)
81+ print (response[ " result " ] )
8282
8383asyncio.run(main())
8484```
@@ -94,12 +94,14 @@ class WebsiteData(BaseModel):
9494 title: str = Field(description = " The page title" )
9595 description: str = Field(description = " The meta description" )
9696
97- client = SyncClient(api_key = " sgai- your-api-key" )
98- response = client .smartscraper(
97+ sgai_client = SyncClient(api_key = " your-api-key-here " )
98+ response = sgai_client .smartscraper(
9999 website_url = " https://example.com" ,
100100 user_prompt = " Extract the title and description" ,
101101 output_schema = WebsiteData
102102)
103+
104+ print (response[" result" ])
103105```
104106</details >
105107
@@ -114,27 +116,24 @@ For detailed documentation, visit [docs.scrapegraphai.com](https://docs.scrapegr
1141161 . Clone the repository:
115117```
116118git clone https://github.com/ScrapeGraphAI/scrapegraph-sdk.git
117- cd scrapegraph-sdk
119+ cd scrapegraph-sdk/scrapegraph-py
118120```
119121
1201222 . Install dependencies:
121123```
122- poetry install
124+ uv sync
123125```
124126
1251273 . Install pre-commit hooks:
126128```
127- poetry run pre-commit install
129+ uv run pre-commit install
128130```
129131
130132### Running Tests
131133
132134```
133135# Run all tests
134- poetry run pytest
135-
136- # Run with coverage
137- poetry run pytest --cov=scrapegraph_py
136+ uv run pytest
138137
139138# Run specific test file
140139poetry run pytest tests/test_client.py
0 commit comments