Skip to content

Commit ee9efa6

Browse files
committed
docs: updated readme
1 parent c16705b commit ee9efa6

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

scrapegraph-py/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ from scrapegraph_py.logger import get_logger
5353
logger = 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
7373
from scrapegraph_py import AsyncClient
7474

7575
async 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

8383
asyncio.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
114116
1. Clone the repository:
115117
```
116118
git clone https://github.com/ScrapeGraphAI/scrapegraph-sdk.git
117-
cd scrapegraph-sdk
119+
cd scrapegraph-sdk/scrapegraph-py
118120
```
119121

120122
2. Install dependencies:
121123
```
122-
poetry install
124+
uv sync
123125
```
124126

125127
3. 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
140139
poetry run pytest tests/test_client.py

0 commit comments

Comments
 (0)